摘要: 上回说到,开始调用 ZygoteInit main 函数,main 函数:registerZygoteServer:注册一个 zygote server socket,所有来自客户端的连接都通过 socket 方式连接;preload:预加载系统的类库和资源,这样其他程序启动将不再加载系统资源,只需加载自己程序的资源,这样就达到系统资源在程序之间共享;startSystemServer: private static boolean startSystemServer() throws MethodAndArgsCaller, RuntimeException { ... 阅读全文
posted @ 2012-05-25 12:37 idiottiger 阅读(4469) 评论(0) 推荐(2) 编辑
摘要: 之前这篇,从整体展示了 android 的整个启动流程,为了搞清楚 android 启动到底在代码层面上是如何调用的,将从源代码角度去分析,另所有代码基于 android 4.0 source tree all story begin with the init process startup 故事从 init 进程启动开始init 运行,代码:system/core/init ,入口:system/core/init/init.c main 函数: 1 int main(int argc, char **argv){ 2 3 ... 4 // 初始化文件系统 ... 阅读全文
posted @ 2012-05-23 17:20 idiottiger 阅读(9941) 评论(1) 推荐(3) 编辑
摘要: 声明: 原文地址:http://www.androidenea.com/2009/06/android-boot-process-from-power-on.html,本文章是在基于该文章的翻译,翻译的不好,请笑纳 -):1.PoweronandbootROMcodeexecution开机并执行 boot ROM代码 AtpowerontheCPUwillbeinastatewherenoinitializationshavebeendone.InternalclocksarenotsetupandtheonlymemoryavailableistheinternalRAM.Whenpowe. 阅读全文
posted @ 2012-05-22 14:35 idiottiger 阅读(2280) 评论(0) 推荐(1) 编辑
摘要: 之前这篇,说的不是太详细,今儿再来详细的说说:1.什么是 OutOfMemoryError: 官方引用:Thrown when a request for memory is made that can not be satisfied using the available platform resources. Such a request may be made by both the running application or by an internal function of the VM. 通俗的讲:就是在请求一块内存的时候,当前可用资源不够用来请求时抛出的一种错误。我们知道, 阅读全文
posted @ 2012-05-08 16:56 idiottiger 阅读(1878) 评论(0) 推荐(0) 编辑
摘要: 每个 android 平台内存限制不一样,从最开始的 16M 到 24M,以及后来的 32M,64M,或许以后会更大。 那如何获取单个 app 内存限制大小呢? class :ActivityManager ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); activityManager.getMemoryClass(); 当然,ActivityManager 不单单限与此,许多对 android 程序管理的工具,都来源与此,或者从这里. 阅读全文
posted @ 2011-07-05 11:06 idiottiger 阅读(1799) 评论(0) 推荐(1) 编辑
摘要: 好像关于android的opengles的开发资料并不多,之前在国外网站上看到个老外写的,写的很好,很明了,拿出来给大家分享下,总共有6部分: 1. Settingup View:http://goo.gl/l3ZYd 2. Building a Polygon: http://goo.gl/kgEpf 3. Transformations: http://goo.gl/UZy2S 4. Adding Colors: http://goo.gl/vrQqA 5. More on Meshes: http://goo.gl/Ywjz5 6. Textures:http://goo.gl/oAb. 阅读全文
posted @ 2011-03-12 12:16 idiottiger 阅读(729) 评论(0) 推荐(0) 编辑
摘要: 众所周知,在写 android 程序的时候,很容易出现 OOM ,而出现的时机大多数是由 Bitmap decode 引发的: 我们知道,android程序内存一般限制在16M,当然也有24M的,而android程序内存被分为2部分:native和dalvik,dalvik就是我们平常说的java堆,我们创建的对象是在这里面分配的,而bitmap是直接在native上分配的,对于内存的限制是 native+dalvik 不能超过最大限制。 用以下命令可以查看程序的内存使用情况: 用android自带的launcher程序为例: 具体每一项代表什么,参考:http://stackoverflo 阅读全文
posted @ 2011-01-09 13:47 idiottiger 阅读(6210) 评论(2) 推荐(0) 编辑