Android System Architecture
I recently started learning developing applications for android OS , i liked it much however developing applications for android is kinda different from what we used to , you must be aware of Android System Architecture, so you can develop powerful applications, let’s start with this Diagram that Explains the Levels of Android System Architecture:
There is 4 levels of android architecture , let’s start with Level #1:
Level #1: Linux Kernel :
Android uses Linux as a hardware abstraction layer and use the powerful of Linux kernel and the wide range of hardware drivers it supports, android uses Linux also for memory management , Networking , managing processes, however you programs will not make Linux calls directly , you always use the Dalvik(Android Virtual Machine).
Level #2 : Native Libraries & Android Runtime:
Native Libraries :
these libraries are written in C/C++ already compiled and preinstalled by vendor for particular hardware abstraction, there is alot of important native libraries such as :
Surface Manager: Android uses a compositing window manager similar to Vista or Compiz, but it’s much simpler. Instead of drawingdirectly to the screen buffer, your drawing commands go into off-screen bitmaps that are then combined with other bitmaps to form the display the user sees. This lets the system create all sorts of interesting effects such as see-through windows and fancy
2d and 3d graphics: there is OpenGL libraries , you can combine 2d and 3d elements in One Single User Interface
Media Codecs: android can play videos and playback , recording , supporting many formats including AAC, AVC(H.264), H.263, MP3 and MPEG-4
SQL Database: Android includes a lightweight SQLite database engine, you can use it for storing persistent data in your application.
Browser Engine: for fast display of HTML content , android uses the WebKit library, the same library used in Google Chrome Browser, safari and iphone.
Android Runtime: for running your applications on android, you will need to use Dalvik !
what is Dalvik ?
it is Android Virtual machine , you compile your code on machine independent then you will have what we call bytecode , but here bytecode is alittle different , Dalvik is essentially a Java Virtual Machine , optimized for low memory usages and it allows multiple VM instances to run at once , it takes advantage of Linux OS for Security and Process Isolation.
ok , so what is the difference between Dalvik and traditional Java ?
there is 2 Major differences :
1)Dalvik VM runs .dex files which are converted at compile time from standard .class and .jar files, dex files are more efficient than class files considering low memory and battery powered devices.
2)the core java libraries that comes with android are different from Java SE (Standard Edition) and ME (Mobile Edition) .
Level #3 : Application Framework:
This layer provides high level building blocks , you will use it to create your applications, it comes preinstalled with android, however you can create your own components,
the most important parts of this framework are :
Activity Manager: your application consists of many events, it is actually controls your application life cycle , for example : you can override methods of Activity class, with onCreate(Bundle) this is called when the activity starts up, you can initialize anything such as creating the user inteface.
content providers: These objects encapsulate data that needs to be shared between applications, such as contacts
there is also Resource manager, Location manager and Notification manager.
Level #4: Applications and Widgets :
this highest level on Android Architecture Diagram, it is the programs that you develop, or application that already comes with android such as phone Dialer, email, contact, web browser,….etc
so what is the difference between applications and gadgets ?
Applications: programs that covers full screen and interacts with user.
Widgets (Gadget): operate only in a small rectangle of the Home screen application.
Hello, Android, 3rd Edition by Ed Burnette