jfo planet

Hope is the best gift that tomorrow gives.

  • 首页
  • 分类
  • 归档
  • 标签
  • 搜索
close

如何调试跟踪Android源代码

发表于 2010-08-26   |   分类于 Android
http://www.cnblogs.com/jacktu/archive/2009/08/31/1557742.htmlAndroid平台代码很多,关系也很复杂,通常我们调试程序的时候是无法跟踪到Android framework code里的,如果能调试跟踪Android source code将给我们这些初学者带来很多便利,本文将给出一个调试跟踪Android source code 的方法。1.    首先,得到Android 源代码(可参考之前的文章–如何获取Android源代码并编译.doc),并且编译,得到output file,在(Android source)/out目录下,也可通过别的途径获取Android source code (以androidsrc.tgz为例) 和别人编译好的 output file(out.tgz)  2.    解压缩这两个 tgz 文件,并把解压出来的out 目录放到 myandroid 目录下,如下图所示。  3.  &# ...
阅读全文 »

Android窗口管理

发表于 2010-08-26   |   分类于 Android
在Activity在performLaunchActivity时,会使用Activity.attach()建立一个PhoneWindow主窗口。这个主窗口的建立并不是一个重点。handleResumeActivity真正要启动一个Activity时候,将主窗口decorView加入到WindowManageronCreate()@UserActivity.java >setContentView()@Activity.java >mWindow.setContentView() >setContentView()@PhoneWindow.java >installDecor(): generateDecor() –> DecorView:ViewGroup generateLayout() –> screen_simple.xml:id:content (FrameLayout) decor.addView( screen_simple.xml )handleLaunchActivity()@ActivityThread ...
阅读全文 »

Android Framework 分析

发表于 2010-08-23   |   分类于 Android
http://raymond1860.spaces.live.com/Blog/cns!BF47B6FD104579C9!797.entry1.目录树/framework/base/api /framework/base/awt/framework/base/build/framework/base/camera 关 于camera的HAL接口库。最终生成native共享库libcamera.so ,编译时根据是否定义USE_CAMERA_STUB来决定系统是否有Camera硬件支持。若没有实际的Camera硬件,则编译时会和虚拟 camera静态库(libcamerastub.a,由camerahardwarestub.cpp,fakecamera生成)链接生成 libcamera.so。/framework/base/cmds 关于android系统启动时用到的command等/framework/base/cmds/am/framework/base/cmds/app_process 可 执行文件app_process,该文件可以根据输入参数决定是Zygo ...
阅读全文 »

Activity启动流程(1)

发表于 2010-08-21   |   分类于 Android
Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1047    ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2459    ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512    ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119    ActivityThread$H.handleMessage(Message) line: 1863    ActivityThread$H(Handler).d ...
阅读全文 »

android 启动流程

发表于 2010-08-20   |   分类于 Android
SystemServer的启动frameworks/base/services/java/com/android/server/SystemServer.java: run()其中调用ActivityManagerService.installSystemProviders(),最终会调用到frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/下的各个content providers的onCreate()函数,初始化数据库内容。。。other ref:http://www.cnblogs.com/jacktu/archive/2010/07/02/1769939.htmlAndroid 核心分析 之八——Android 启动过程详解Android从Linux系统启动有4个步骤;(1) init进程启动(2) Native服务启动(3) System Server,Android服务启动(4) Home启动 总体启动框架图如: 第一步:initial进程(systemcore ...
阅读全文 »

How to Create Android Update Zip Package

发表于 2010-08-11   |   分类于 Android
How to Create Android Update Zip PackageThere are several ways to install applications or  library files to an Android Phone. You can use Market application to find and install or adb command line tool to install or push the files to Android file system. These are all easy to implement for  single  file but if you have several applications or library files to install at once, it might be better to use update zip file. The update zip file is Android advanced system to install ...
阅读全文 »

经典小故事

发表于 2010-08-10   |   分类于 Saying
扁鹊的医术魏文王问名医扁鹊说:“你们家兄弟三人,都精于医术,到底哪一位最好呢?”扁鹊答:“长兄最好,中兄次之,我最差。”文王再问:“那么为什么你最出名呢?”扁 鹊答:“长兄治病,是治病于病情发作之前。由于一般人不知道他事先能铲除病因,所以他的名气无法传出去;中兄治病,是治病于病情初起时。一般人以为他只能 治轻微的小病,所以他的名气只及本乡里。而我是治病于病情严重之时。一般人都看到我在经脉上穿针管放血、在皮肤上敷药等大手术,所以以为我的医术高明,名 气因此响遍全国。”管理心得:事后控制不如事中控制,事中控制不如事前控制,可惜大多数的事业经营者均未能体会到这一点,等到错误的决策造成了重大的损失才寻求弥补。而往往是即使请来了名气很大的“空降兵”,结果于事无补。 曲突徒薪有位客人到某人家里做客,看见主人家的灶上烟囱是直的,旁边又有很多木材。客人告诉主人说,烟囱要改曲,木材须移去,否则将来可能会有火灾,主人听了没有作任何表示。不 久主人家里果然失火,四周的邻居赶紧跑来救火,最后火被扑灭了,于是主人烹羊宰牛,宴请四邻,以酬谢他们救火的功劳,但并没有请当初建议他将木材移走,烟 囱改曲的人。 有人对 ...
阅读全文 »

Data Storage

发表于 2010-07-18   |   分类于 Android
Using the Internal StorageYou can save files directly on the device’s internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed.String FILENAME = "hello_file";String string = "hello world!";FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);fos.write(string.getBytes());fos.close();Tip: If y ...
阅读全文 »

通过Theme设置一些判断标志

发表于 2010-07-15   |   分类于 Android
有时候需要通过当前应用的Theme,来判断当前应用所处的环境。可以通过在Theme中设置一些flag来实现。1. 添加flag属性在frameworks/base/core/res/res/values/attrs.xml的“<declare-styleable name="Theme">”中添加:<declare-styleable name="Theme"> <!– flag to decide whether it is our theme –> <attr name="myflag" format="boolean" />… </declare-styleable>2.自定义Theme在所需的应用中添加一下判断语句即可:<style name="myTheme" parent="android:Theme.Light.NoTitleBar"> ...
阅读全文 »

Android Surface (double buffered)

发表于 2010-07-12   |   分类于 Android
http://blog.chinaunix.net/u2/85805/showart_1882368.html> Hi All, > I’ve been using SurfaceView and Surface for one of my graphics > project. > The problem keep bothering me is that the content in Surface’s two > graphic buffers does not synchronized so that when the "lockCanvas- > drawCanvas-unlockCanvas" cycle is running, it shows different content > and generate screen flicker. Here is some information on how the Android graphics system works: In Android, every ...
阅读全文 »
1…202122…61
jfo

jfo

605 日志
38 分类
4 标签
RSS
GitHub 微博
友情链接
  • 收藏夹
  • 网络剪贴板
  • 爱逛吧
© 2007 - 2018 jfo
由 Hexo 强力驱动
主题 - NexT.Pisces