Android is the most widely used operating system (presently 82.8%) in the world. Below is the Android’s architecture diagram. It contains various layers like application layer, Application framework, Libraries, Android Runtime and Linux kernel. We will explore each and every layer in details.
Application Layer: User only interacts with mobile apps at application layer. When we install a app in our device and start using it , we use it from the application layer. Apps like chrome, Facebook, Instagram, gmail, Bhim, YouTube etc are works on the application layer. Android apps are written in the Java programming language. One apk file contains all the contents of an android app and that apk file is use to install in the mobile device or android emulators. The android SDK tools compile your code along with any data and resource file-into an apk.
Android java code files compiles to .class files via java compiler, .class files is also known as java byte-code this byte code further get converted to dalvik byte-code which is the format which android os understand. All .class files and any .jar library files compile to single classes .dex using dx command. DEX is called as Dalvik executable files.
There are following four components of app:-
- Content Provider component supplies data from one application to others on request.
- Content Provider is helpful when an app want to share data with another app.
- An activity represents a single screen with a user interface. It’s like every new screen is a activity. One activity for login and another activity for login successful.
- A service is a component that runs in the background.
- A service might download some data while user is in a different application or play music while user is doing other activity.
- A broadcast receiver is a component that responds to system-wide broadcast announcements.
- Apps can also send a broadcast message to other app know that some data has been downloaded to the device and is available for them to use.
- When a user see a low battery message to his/her phone screen that message is a broadcast message.
Application Framework: The Application Framework layer provides higher-level services to applications like Activity Manager, windows manager, content Provider, View system, notification manager in the form of Java classes.
Android Runtime (ART): ART is a alternative to Dalvik Virtual Machine. ART is because of Ahead-of-time Compilation and Garbage Collection. In AOT Compilation, android apps will be compiled when user installs them in their device whereas in the Dalvik use Just-In_time(JIT) compilation in which bytecode are compiled when user runs the app.
Libraries: Layer 3 provides the libraries for the android apps. SQLite library is used for SqL Database, Webkit library is used for browsing the web, SSL library is used for certificate, and Audio manager library is used for managing the audio and so on.
Linux kernel: Linux Kernel provides basic system functionality like process management, memory management, device management like camera, keypad, display etc.
That’s All For Today.