Chapter 2: Key Concepts

8 views
Skip to first unread message

Piyush Mattoo

unread,
Feb 10, 2013, 1:04:10 AM2/10/13
to android_...@googlegroups.com

The second chapter (Key Concepts) talks about the Android system architecture starting with Linux Kernel (hidden to the Android user) which provides the hardware abstraction layer for Android and is used for OS services like networking, memory/process management. The next layer comprises of Android native libraries which are precompiled by the phone vendor for a particular hardware architecture. The libraries include Media codecs to play and record videos, SQLLite database, Webkit library engine which is the same engine used in the Google chrome browser. Next to this layer is the Android runtime which comprises of Dalvik virtual machine (google’s implementation of Java) and core Java libraries. Since memory is a huge concern on mobile devices, Dalvik VM runs .dex files which are compiled from standard .class files and are more compact compared to .class files. On top of native libraries and Android runtime is the Application Framework layer which provides various building blocks like activity manager, content provider etc to help build our applications. At the top is the Applications and Widget layers and is visible to the end user.

In Android, each User Interface screen is represented by an Activity class which has its own lifecycle and is not tied to the process lifecycle. Lifecycle of the Activities are managed by the system and we get notified via onXX() method class. Different states of Activity are Starting, Running, Paused, Stopped, Destroyed. Activities that are not running the foreground may be stopped or Linux process that houses them may be killed at any time to make room for new activities. So, it is important to save any data we need to keep around for next time inside onPause() as it may be the last method called in our Activity.

The chapter further talk about different building blocks like Activities (User interface screen),  Services (running in the background), Content provider (sharing data between applications). Then it talks about resources which are small piece of non-code information that our program needs and they reside within the res directory inside our project. The resource compiler compresses and packs resources and generates a class named R to reference those resources.

Reply all
Reply to author
Forward
0 new messages