1. Introduction into development of Android applications

1.1. The Android operating system

Android is an operating system based on the Linux kernel. The project liable for developing the android system is termed the android Open source Project (AOSP) and it lead by Google.


This android operating system is divided into the four areas as delineated in the following graphic. An android application developer usually works with the two layers on top to make new android applications.

The Android Framework is as above

 

1.1.a Linux Kernel

The first layer and the simplest one is the kernel, the complete operating system builds on top of it. The most recent version of android (Nougat7.0) is constructed on top of the Linux kernel.
The kernel has 2 main jobs. The primary job is to interact with the hardware and act as an abstraction layer between the hardware and alternative software. Hence, part of the kernel is device drivers (e.g Bluetooth, camera, Wi-Fi, etc…). The second job is providing the core functionality of the operating system as well as memory management, process management, power management, networking and security.

1.1.b Libraries

The next layer is the android native libraries, they sit on top of the kernel & provide a core set of functionalities. Among the far-famed libraries are “OpenGL” accustomed render 2D and 3D content onto the screen, “SQLite” a database engine which handles data storage and “WebKit” which is the browser engine.

1.1.c Android Runtime

The android runtime is a java virtual machine that’s optimized for android a.k.a. Dalvik Virtual Machine. owing to security concerns, all android applications run sandboxed in this virtual machine.

However, you ought not to worry regarding slow performance because android uses “Just-in-time (JIT) compilation”. Parts of the bytecode are compiled into quicker machine-code on-the-go, ‘just within time’ for execution in a process.

You might wonder, why not compile all application into machine language within the 1st place. once you compile into machine language, you’re compiling for a particular CPU and can’t use it on a distinct architecture and so the app will need to be compiled for every available configuration out there. Google opted for the second alternative wherever one version of app is available on the Play Store and use JIT compilation to enhance performance.

Currently, Google is experimenting with an “Ahead-of-Time (AOT) compiler” where the app is compiled in the native code when doing the installation. This may bring better performance and improved battery life (no need for a JIT compiler when running apps)

1.1.d Application Framework

This layer provides the building blocks that your application interacts with. They additionally provide variety of services.  This layer provides the tools every developer uses to develop android apps. Among the necessary building blocks is:

-Activity manager: manages the lifecycle of the application.

-Content provider: manages data sharing between applications.

-Resource manager: manages the different resources within an application.

1.1.e Applications

These are the apps you write or that come pre-installed. it’s worth mentioning that the apps that come with android (e.g. dialer, contact manager) don’t have access except to a similar building blocks provided by the application framework. A developer can replace the apps with the custom ones. This shows that the developer is practically limitless in what he can achieve with android.

Android is published in different version, which are listed in the following table.

Table 1. Android versions
Code name Version API level
Nougat N 24
Marshmallow 6.0 23
Lollipop 5.1 22
Lollipop 5.0 21
KitKat 4.4 – 4.4.4 19
Jelly Bean 4.1.x – 4.3.x 16 – 18
Ice Cream Sandwich 4.0.1 – 4.0.4 14 -15
Honeycomb 3.2.x 13
Honeycomb 3.0 – 3.1 11 – 12
Gingerbread 2.3 – 2.3.7 9-10
Froyo 2.2.x 8
Eclair 2.1 7
Eclair 2.0 – 2.0.1 5 -6
Donut 1.6 4
Cupcake 1.5 3
(no code name) 1.1 2
(no code name) 1.0 1