The Android Operating System

Android is an open-source mobile operating system. It is a variant of Linux hence providing extensive security, modularity and productivity at the mobile device level. Android is developed and maintained by the organization called “Open Headset Alliance” (OHA). OHA was established in 2007 with Google being its foremost member. OHA includes a lot of prominent hardware and software companies.

Originally, Android was created by a company called Android Inc. Google acquired this company in 2005. After then, Google made it open source and Android gained a big momentum. Android has the market share of around 85% in 2016

Market shares of mobile operating systems between 2015-Q4  and 2016-Q3
Market shares of mobile operating systems between 2015-Q4 and 2016-Q3

Android is utilized not only in smartphones but also in tablets, netbooks, digital television boxes, handheld game devices and even in single board computers such as UDOO

How do Android Apps Work ?

There are different ways the programs run on various platforms. The lowest level software can be written in machine code that runs directly on the microprocessor

Since it is difficult to develop complex applications in machine code, operating systems are used. Operating systems provide a communication and control layer between the application software and the hardware

If we want to develop a native application for running on a specific hardware/operating system, we have to do this using a compiler and linker. Compiler and linker takes the source code and creates the executable file that actually runs on the operating system

Machine code – hardware relation
Machine code – hardware relation

For example, if we want to develop an application in C++ programming language, we have to utilize the compilation/linking process.

Operating system layer between the hardware and the app
Operating system layer between the hardware and the app

The main advantage of native applications is their speed. However, the disadvantage is the incompatibility across different platforms. For example, we cannot run a native Windows application on Ubuntu and vice versa. Virtual machine concept is developed to overcome this limitation. Virtual machine is software that runs on the operating system and provides an abstraction to the developer

Creating a native executable from the source code
Creating a native executable from the source code

Therefore, as long as a computer has the virtual machine running, the application software can run on that computer independent of the hardware and the operating system. A good example is the Java Virtual Machine (JVM). JVM runs on almost all operating systems and platforms. Therefore, when we develop Java software, it will be run on the JVM independent of the operating system/platform.

Virtual machine between the app and the operating system
Virtual machine between the app and the operating system
Creating an intermediate code from the source code –
intermediate code is interpreted by the virtual machine
Creating an intermediate code from the source code –
intermediate code is interpreted by the virtual machine

Similar to Java applications, Android applications also run on a JVM. There are two special virtual machines used in Android: Dalvik Virtual Machine (DVM) and Android RunTime (ART). These are specialized JVMs which can run on low system resources. The .apk files (executables of Android apps) actually run on these virtual machines.

DVM has been the default runtime environment (~ virtual machine) until the Lollipop release (Android 5.0). ART is introduced by Android 4.0 and has been the default VM as of Android 5.0. DVM and ART basically do the same job: running Android apps independent of the platform.

The main advantage of ART over DVM is the utilization of a concept called Ahead of Time (AOT) compilation instead of Just in Time (JIT) approach. In AOT, apps are compiled during installation hence they load faster with lower CPU usage. On the other hand, JIT compilation provides lower storage space consumption with relatively longer loading times

Programming Languages Used For Developing Android Apps

The recommended and convenient way of developing Android apps is using Java programming language. Although Java is a general purpose tool, it is used in conjunction with Android Software Development Kit (SDK) in Android Studio environment to develop apps.

Another official way is using C++ with the Native Development Kit (NDK). This option is used for developing apps with low level instructions such as timing sensitive drivers. With C++ and NDK, we can directly run the app on the Android kernel hence increasing efficiency in exchange of code length and development cost.

There also exist third-party tools like Xamarin, Crodova and React Native for developing apps. These platforms provide convenience however a native-like performance isn’t normally expected from the apps developed by third party tools.

Kotlin is also used to develop Android applications

Leave a Comment