How Android works: The big picture

How Android works: The big picture

Summary: Some parts of Android will be familiar, such as the Linux Kernel, OpenGL, and the SQL database. Others may be completely foreign, such as Android's idea of the application life cycle. You'll need a good understanding of these key concepts in order to write well-behaved Android applications. Let's start off by taking a look at the overall system architecture--the key layers and components that make up the Android stack. Excerpted from an upcoming book.

SHARE:

[This article is part of a continuing series on Android, Google's new mobile phone platform. It is excerpted from an upcoming book. --Ed]

Some parts of Android will be familiar, such as the Linux Kernel, OpenGL, and the SQL database. Others may be completely foreign, such as Android's idea of the application life cycle. You'll need a good understanding of these key concepts in order to write well-behaved Android applications.

[ READ: More articles on Android ]

Let's start off by taking a look at the overall system architecture--the key layers and components that make up the Android stack. The following diagram (courtesy of Google) shows the "20,000 foot" view of Android:

How Android works: The big picture

Starting at the bottom is the Linux Kernel. Android uses Linux for its device drivers, memory management, process management, and networking. However you will never be programming to this layer directly.

The next level up contains the Android native libraries. They are all written in C/C++ internally, but you'll be calling them through Java interfaces. In this layer you can find the Surface Manager (for compositing windows), 2D and 3D graphics, Media codecs (MPEG-4, H.264, MP3, etc.), the SQL database (SQLite), and a native web browser engine (WebKit).

Next is the Android runtime, including the Dalvik Virtual Machine. Dalvik runs dex files, which are coverted at compile time from standard class and jar files. Dex files are more compact and efficient than class files, an important consideration for the limited memory and battery powered devices that Android targets.

The core Java libraries are also part of the Android runtime. They are written in Java, as is everything above this layer. Here, Android provides a substantial subset of the Java 5 Standard Edition packages, including Collections, I/O, and so forth.

The next level up is the Application Framework layer. Parts of this toolkit are provided by Google, and parts are extensions or services that you write. The most important component of the framework is the Activity Manager, which manages the life cycle of applications and a common "back-stack" for user navigation.

Finally, the top layer is the Applications layer. Most of your code will live here, along side built-in applications such as the Phone and Web Browser.

One of the unique and powerful qualities of Android is that all applications have a level playing field. What I mean is that the applications Google writes have to go through the same public API that you use. You can even tell Android to make your application replace the standard applications if you like.

In the next installment we'll take take a closer look at the components in the Android Application Framework.

Related articles:

Did you find this article helpful? Have a suggestion? Leave a comment and let me know.

Topics: Operating Systems, Android, Google, Linux, Open Source, Software, Software Development

Ed Burnette

About Ed Burnette

Ed Burnette is a software industry veteran with more than 25 years of experience as a programmer, author, and speaker. He has written numerous technical articles and books, most recently "Hello, Android: Introducing Google's Mobile Development Platform" from the Pragmatic Programmers.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

16 comments
Log in or register to join the discussion
  • So what's new and special about it?

    Take computer... load Linux.. load Java.... tell programmer he/she can only write Java programs.

    Not entirely sure how this is special, novel, or anything other than Google bandwagon jumping at it's finest.
    croberts
    • I agree...

      This isn't anything special. The Windows world has had a similar model, far more robust for years. Its just Google's way of taking advantage of the free stuff everyone else has done.

      Nothing new or exciting here.
      GeiselS
    • Here are some things that are special

      Here are some things that are special about Android:

      - Application life cycle and automatic process management frees the end user from worrying about what applications are active

      - Location based services and notifications

      - Wide open 'Intents' architecture which allows you to share and reuse components. You can even easily replace built-in components.

      - Standard 2d and 3d graphics with optional acceleration

      - High quality audio/video support including H.264 (AVC).

      - Low power operation

      - Mashup-ready: Embed browser and map views directly in your applications
      Ed Burnette
      • lifecycle

        This is something that I hope works better than on Windows Mobile.

        If you are on a stock page or something that auto updates, you can ring up a big wireless bill quickly if you "close" your browser and it still keeps running in the background getting updates for the stock market.

        I'm not sure that I buy into the paradigm of the whole thing, but Google deserves some credit for trying to make a standardized platform out of open-source.
        croberts
  • It will be interesting to see...

    ...how Android will be, if at all, preferenced over [url=http://www.forum.nokia.com/main/platforms/s60/index.html#_S60_3rd_Edition]Symbian S60.[/url]
    D T Schmitz
    • so why....

      ..did Nokia just buy Trolltech/Qt? Because they think S60 is a viable platform? Or because they're positioning Qt+Maemo as the platform that will complete with Android?
      zydeco100@...
      • Both

        Nokia seems to be gearing up for a battle with Android and other Linux based phones in the next few years. I think they're going to lose in the long run (don't bet against open source) but the competition will be intense.
        Ed Burnette
  • Interesting

    No .net

    No C#

    Just the cross-platform goodness of Linux, C/C++ and Java.

    Microsoft, you may go and change your trousers now.
    whisperycat
    • Amusing

      Hopefully you are wrong and Linux + C + Java are not actually the pinnacle of computing achievement.

      Not that .NET is either, but come on. Surely we can do better.
      croberts
  • Can you say: Qt/Embedded?

    [url=http://www.nokia.com/A4136001?newsid=1185531]Nokia acquires Trolltech[/url]

    Android is an 'infant' compared to Qt.
    D T Schmitz
    • Can you say: Qtopia is a pain?

      Ever try to remotely install an application onto a Qtopia device? Android has a few things figured out that Trolltech doesn't have yet. Isolated process space, separate JVMs per process, package handling, better security model.

      Android may be an infant, but Rubin knows his stuff and has been working on phones way longer than Trolltech. The Greenphone was nothing to write home about.
      zydeco100@...
      • If...

        ...I can currently install KDE on my Debian-based Linux Nokia N800 (and I can), then you can be sure down the line you'll see plenty of Qt devices from Nokia.

        Nokia is about 3 years, technology-wise, ahead of the competition.

        [url=http://nseries.com/open]Nokia: Open to Anything[/url]
        D T Schmitz
  • wikipedia

    Hello Mr. Burnette!
    May i ask if i can use ur picture to put it into wikipedia side about android? I really like the overview!!
    vorname44@...
    • To contact me directly click on Bio

      To contact me directly click on the 'Bio' link, and then click 'Email Ed Burnette'.
      Ed Burnette
  • RE: How Android works: The big picture

    So, what do you see as the most uniqu selling point for it to take the market by storm after have something so radical like iPhone?
    saigeethamn@...
    • I listed a few here...

      I listed a few here:
      http://talkback.zdnet.com/5208-12353-0.html?forumID=1&threadID=43632&messageID=807454&start=-9984

      If I had to pick just one, from the users point of view I might pick pervasive location based services, and from the developers point of view I might pick its openness and level playing field.
      Ed Burnette