Thursday, October 9, 2014

System applications in Android framework

Android applications are two types.

1)      System applications
2)      User applications

System app is located under /system/app folder. System apps are granted the ability to request certain system-only permissions that are never available to user apps. 

The source code for all system applications are located at ANDROID_SRC/packages/. In this recipe, we will learn the significance of the most important packages at this location.


Navigate to the /packages directory under ANDROID_SRC/.
The following table summarizes the four top-level directories and the code they contain:
Directory  name
Purpose
Apps
Contains code for Activity-based applications. Always contains a UI element.
Experimental
Random tools maintained by Googlers. Contents may be archived without notice.
Inputmethods
The sources for the three default IMEs (as per 2.3.4_r1), that is LatinIME, OpenWnn, and PinyinIME
Providers
Code for all major content providers including Contacts and SMS/MMS
Wallpapers
Code for wallpapers that ship with the open source system

Now, we will learn the purpose of the most important directories under Apps and Providers.

Directories under /Apps:

Directory name
Purpose
Browser/
The frontend of the Android browser
Camera/
The camera app
Contacts/
Frontend Contacts application
Gallery/
Application that lets you view images and videos on your SD card
Launcher2/
The default launcher screen
Mms/
MMS/SMS application
Nfc/
NFC control application including native library that interacts with NFC chip. Includes the NFC manager and Nfc service
Phone/
The dialer application and call-answering UI
Settings/
System settings and secure settings application

Directories under /Providers:
Directory name
Purpose
ApplicationsProvider/
Maintains a database of all installed applications
ContactsProvider/
Code that maintains the Contacts datastore that is used by innumerable services on the device
TelephonyProvider/
Stores three types of data: SMS content, MMS content, and current network configuration

All of the above applications have a make file that is picked up by the Android built system during a full system build. The built APKs are packaged into system.img and during system bootup they are installed into the /system/app directory.