Android Fundamentals
當然是google的說明文檔最權威了,給出鏈接:
http://developer.android.com/guide/topics/fundamentals.html
然后,是我自己的一點感悟:
1.
先上傳個經典的架構圖
關于這幅圖,值得說明的是:
(1)應用開發者主要研究的是application framework這一層,隨著google開發ndk開發模式,c/c++程序員可以編寫本地庫。
對于內核研究人員,當然什么都是沒有限制的,移植的主要任務是內核的移植,其他的都是選擇性的。
(2) 注意Dalvik Virtual Machine的位置,和libraries屬于同一層,但是又用到了c/c++的lib的東西,所以是在lib偏上的位置,
Dalvik虛擬機執行的是.dex格式的字節碼,由.class格式轉化而來,如果要做破解,有逆向進行轉換的工具。
2.
直接引用google的一點說明
- The Android operating system is a multi-user Linux system in which each application is a different user.
- By default, the system assigns each application a unique Linux user ID (the ID is used only by the system and is unknown to the application). The system sets permissions for all the files in an application so that only the user ID assigned to that application can access them.
- Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.
- By default, every application runs in its own Linux process. Android starts the process when any of the application's components need to be executed, then shuts down the process when it's no longer needed or when the system must recover memory for other applications.
可見android的應用不等于進程,他們各自有自己的生命周期,一個應用相當于一個user,非常便于權限管理。
3.
應用程序主要由四大組件構成,分別是Activities,Services,Content providers,Broadcast receivers。應用組件里除了content providers之外都可以用intent對象激活,
關于intent描述如下:An intent is created with an?Intent?object, which defines a message to activate either a specific component or a specific?type?of component—an intent can be either explicit or implicit, respectively.每一個compnent在使用時必須在manifest文件中聲明,當然,manifest是非常關鍵的,他的作用當然不僅僅是聲明組件,還有聲明權限,apilevel等。
4.
資源文件的管理是非常方便的,只要你加到對應的文件夾下,adt就會自動的掃描,并在R.java文件的類中生成相應的操作句柄,當然這個過程有時候有點慢,clean一下就好了。android應用程序的用戶interface
可以用java代碼和xml文件聲明兩種方式方式來進行,google推薦用第二種方式,注意用xml文件聲明的方式并不低效,因為在最后發布的.apk程序包中并沒用xml文件,adt插件已經將其轉化為相應的二進制碼。
5 這里僅僅做個入門介紹,限定在某個平臺上的應用開發,學習方法還是在熟悉基本框架的基礎上多敲代碼,多實際做東西。google的幫助文檔要常常去查。
轉載于:https://www.cnblogs.com/liujiahi/archive/2011/09/30/2196550.html
總結
以上是生活随笔為你收集整理的Android Fundamentals的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 阿里巴巴python教程_阿里巴巴工程师
- 下一篇: android sina oauth2.