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
transitions.

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.

Reference:

Hello, Android, 3rd Edition by Ed Burnette

Advertisements
    • Asaf
    • August 18th, 2010

    Firefox doesn’t use WebKit library
    it uses Gecko

      • kebomix
      • August 18th, 2010

      ooops , i meant Google Chrome , thanks for the catch 🙂
      i fixed it .

    • deltastorm
    • August 18th, 2010

    It seems mighty weird and interesting now that people are all of a sudden claiming Dalvik to be just another version of Java. Coincidence? *shrugs* But anyway its like saying the Python or Ruby VM’s are essentially Java virtual machines that just run different bytecodes.

      • kebomix
      • August 18th, 2010

      i agree , Android is essentially Java virtual machine with special features i mentioned above.

        • deltastorm
        • August 18th, 2010

        Actually I believe we disagree. Dalvik is no more a JVM than the Ruby VM, Python VM, Parrot etc… You could potentially convert any bytecode from one VM format to another. Its just funny that now all of a sudden there are a few people running around claiming that its a Java VM. And no matter what architectural difference are pointed out they try to equate it to a JVM simply because its a VM and they decided to convert Java bytecode over to their format. They could have chosen any other language or their own invention. In fact I don’t think anyone would even mention Java had they used another language/bytecode format.

    • horkhunter
    • August 18th, 2010

    deltastorm :
    Actually I believe we disagree. Dalvik is no more a JVM than the Ruby VM, Python VM, Parrot etc… You could potentially convert any bytecode from one VM format to another. Its just funny that now all of a sudden there are a few people running around claiming that its a Java VM. And no matter what architectural difference are pointed out they try to equate it to a JVM simply because its a VM and they decided to convert Java bytecode over to their format. They could have chosen any other language or their own invention. In fact I don’t think anyone would even mention Java had they used another language/bytecode format.

    well ,to me – it’s not clear what you want to say 😀 , we know that Dalvik change the bytecode from java’s to it’s own ! what’s wrong in that ?

      • deltastorm
      • August 18th, 2010

      Nothing is wrong with it. I’m simply saying that this doesn’t make Dalvik a Java VM.

        • kebomix
        • August 19th, 2010

        ah , finally i got what you mean 😀 (hope i got it right :D) , i was so confused , so you think what Dalvik do by converting java formats to it is own dex format doesn’t make it a VM , i think it is a VM , it runs on the top of linux +provides a complete abstraction + dalvik provides an execution environment in the form of a dalvik-bytecode instruction set and a runtime system the same as jvm , all the difference made, is converting to dex files, you still need a vm to run these dex files.

    • ManS
    • August 19th, 2010

    Thanks Kebomix for this great tutorial;).
    hope to continue .

      • kebomix
      • August 19th, 2010

      thanks Mans 😉
      i will continue ISA 🙂
      Ramadan Mubarak

  1. what a great introduction , thanks for such informations 😀

      • kebomix
      • August 19th, 2010

      Thanks ahmedemad, Glad it helped 😉

  2. This post just as same as my post in my blog. I wrote it in bahasa indonesia. Anyway, nice post dude 🙂

      • kebomix
      • August 21st, 2010

      !!!!!!
      any link to your post ?

    • Ruby
    • March 17th, 2012

    Very helpful.I am just a beginer

  3. Thanks for posting! Good read.

  4. You could have observed very interesting details ! ps nice web page.

  5. Great post. I was checking continuously this weblog and I’m inspired! Extremely helpful information particularly the remaining part 🙂 I handle such info much. I was seeking this particular info for a long time. Thank you and good luck.

  6. Useful info. Fortunate me I discovered your website by accident, and I’m shocked why this accident did not happened earlier! I bookmarked it.

  7. fantastic put up, very informative. I wonder why the opposite experts of this
    sector do not notice this. You must proceed your writing. I’m sure, you have a huge readers’
    base already!

  8. You portrait thhe subject matter in a vdry different way.

    I really like to write a post that is similar to this.
    Can you provide mme with a few tips?

  9. It’s an awesome piece of writing for all the web people; they will get advantage from
    it I am sure.

  10. Thankfulness to my father who shared with me about this website, this web site
    is in fact amazing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s