Android (SDK)

Internally, Android uses Linux for its memory management, process management, networking, and other operating system services. The Android phone user will never see Linux or in other words our application will not make Linux calls directly.

Android is built on top of a Linux kernel which provides a hardware abstraction layer for it for e.g. Bluetooth stack. This distribution makes Android easily portable to a variety of platforms. A layer consisting of C/C++ libraries are embedded on top of Linux kernel. Some of these libraries handle tasks related to graphics, multimedia codecs, database and browsers (WebKit). Android runtime has its own custom optimized java virtual machine called Dalvik VN. This is because of the reason that native Android Java libraries are different from standard Java or Java Mobile Edition (JME) libraries. JME is an adaptation of Java Standard Edition to allow Java to run on embedded devices such as mobile phones.

Application framework provides various managers to access all hardware related services. Most of these managers come as bundle of Java classes. A detail overview about application framework is given below.

Before we dive in to Application Framework layer, note that the Application layer is the tip of Android iceberg. This is where a user interacts with the phone while unaware of all the action taking place beneath this layer. Some applications are pre-installed on a phone while most are developed and placed on the Android market for free download or for a small price. Our objective is to develop a application and put it on the Android market for free download.

Fig. 1 Android Architecture Layers[1]

Application Framework

Application Framework sits on top of native libraries, android runtime and Linux kernel. This framework come pre-installed with high-level building blocks that developers can use to program applications. Following are the most important application framework components for our application and Android development in general.

Fig. 2 Android Application Framewrok Bundles

Activity Manager
Activity is a single focused thing. Activities can run in the foreground giving direct interaction to the user e.g. current window/tab, they can run as background services or they can be embedded in other activities.


Fig 7. Android Activity Lifecycle [2]

The entire lifecycle is defined by certain methods or states as shown in figure 4.

 

Figure 4. Important methods of Activity

All activity classes must have a corresponding <activity> declaration in AndroidManifest.xml.

Contents Provider

Content provides handles data across applications globally. Android comes with a set of built in content providers to handle multi-media data or contacts etc. Developers can make up their own providers for flexibility or they can incorporate their data in one of the existing providers. For our specific application, we are interested in content://browser to access online data through browser interface.

View System

View system binds all the classes together that handle graphical user interface (GUI) related elements. All views elements are arranged in a hierarchical single tree manner. They can be called from a java code or included in XML layout files. One good thing that we noticed about Android development is extensive use of XML files. These files provide a nice abstraction between backend java code and layout elements. Designing UI related elements is done in the same fashion as HTML based web designing.

Resource Manager

Resource Manager handles all non-code things. These can be anything ranged from icons, graphics or text. Such resources reside under res directory as can be seen under Eclipse Project Explore in the following figure 5.

Fig. 5. Eclipse Project Explorer

All the icons and design work that we have done so far using Adobe Illustrator will reside under these layout directories.

Location Services

This bundle supports fine-grained location providers such as GPS and coarse-grained location providers such as cell phone triangulation. LocationManager system service is the central component of the location framework. This system service provides an underlying API to access device location information. Besides LocationManager class, are several other important classes from android.location that are important to location aware applications such as Geocoder, GpsSatellite and LocationProvider.

 


[1] http://developer.android.com/guide/basics/what-is-android.html

[2] Ed Burnette. Hello, Android Introducing Google’s Mobile Development Platform, 2nd Edition.