Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Stack
Jackson F. De A. Mafra
Curso: Desenvolvimento Mobile
Android
The Stack| Stack Overview
The Android operating system is like a cake consisting of
various layers. Each layer has its own...
The Stack| Linux
Android is built on top of the Linux kernel. Linux is a great
operating system, and is the poster child o...
The Stack| Linux
Portability
Linux is a flexible platform that is relatively easy to port to
various hardware architecture...
The Stack| Linux
Security
Linux is a highly secure system, having been tried and tested
through some very harsh environmen...
The Stack| Linux
Features
The Linux kernel comes with a lot of very useful features.
Android leverages many of them, such ...
The Stack| Android != Linux
Keep in mind that Android is not just another flavor of Linux,
in the way that Ubuntu, Fedora,...
The Stack| Native Layer
The native layer is a set of code that is written mostly in
C/C++. Unlike the Linux layer, the nat...
The Stack| HAL
Android was designed to run on many different hardware
configurations, and an An‐ droid app shouldn’t care ...
The Stack| Native Libraries
The native libraries are C/C++ libraries. Their primary job is to
support the Android Applicat...
The Stack| Native Libraries
Bionic
An Android-specific implementation of libc library, derived
from the BSD project and up...
The Stack| Native Libraries
Binder
A very fast inter-process communication mechanism that
allows for one Android app to ta...
The Stack| Native Libraries
Framework libraries
Various libraries designed to support system services, such as
location, m...
The Stack| Native Libraries
Webkit
A fast web-rendering engine used by Safari, Chrome, and
other browsers.
The Stack| Native Libraries
SQLite
A full-featured SQL database that the Android app framework
exposes to applica‐ tions.
The Stack| Native Libraries
Apache Harmony
An open source implementation of Java libraries.
The Stack| Native Libraries
OpenGL
3D graphics libraries.
The Stack| Native Daemons
Native daemons are executable code that usually runs to
support some kind of system service. Exa...
The Stack| Native Daemons
Installation daemon (installd)
Supports management of apps, including installation,
upgrades, as...
The Stack| Native Tools
Native tools include many standard Linux command-line tools, as
well as the init process that is r...
The Stack| Dalvik
Dalvik is a purpose-built virtual machine designed specifically for
Android.
The Java virtual machine (V...
The Stack| Android and Java
In Java, you write your Java source file, compile it into Java byte
code using the Java compil...
Stack
Jackson F. De A. Mafra
Curso: Desenvolvimento Mobile
Android
Upcoming SlideShare
Loading in …5
×

Curso de Desenvolvimento Mobile - Android - Stack

421 views

Published on

Published in: Mobile
  • Be the first to comment

  • Be the first to like this

Curso de Desenvolvimento Mobile - Android - Stack

  1. 1. Stack Jackson F. De A. Mafra Curso: Desenvolvimento Mobile Android
  2. 2. The Stack| Stack Overview The Android operating system is like a cake consisting of various layers. Each layer has its own characteristics and purpose—but the layers are not always cleanly separated and often seep into one another.
  3. 3. The Stack| Linux Android is built on top of the Linux kernel. Linux is a great operating system, and is the poster child of open source. Its kernel has been hardened and tightened over the years by many engineers continually improving it.
  4. 4. The Stack| Linux Portability Linux is a flexible platform that is relatively easy to port to various hardware architectures. What Linux brings to Android is a level of hardware abstraction. Because Android is based on the Linux kernel, we don’t have to worry too much about underlying hardware features. Most low-level parts of Linux have been written in fairly portable C code, which allows for third parties to port Android to a variety of devices.
  5. 5. The Stack| Linux Security Linux is a highly secure system, having been tried and tested through some very harsh environments over the decades. Android relies heavily on Linux for security, and all Android applications run as separate Linux processes with permissions set by the Linux system. As such, Android passes many security concerns to the underlying Linux system. Unlike some other Java-based mobile platforms, in Android the kernel is the sole enforcer of Android permissions. This allows for a simple, yet very powerful, security mechanism. It also allows Android apps access to native code, such as fast C implementations of various libraries via the Java Native Interface.
  6. 6. The Stack| Linux Features The Linux kernel comes with a lot of very useful features. Android leverages many of them, such as support for memory and power management, as well as networking and radio functionality.
  7. 7. The Stack| Android != Linux Keep in mind that Android is not just another flavor of Linux, in the way that Ubuntu, Fedora, or Red Hat are. Many things you’d expect from a typical Linux distribution aren’t available in Android, such as the X11 window manager, the ability to add a person as a Linux, or even the glibc standard C library. On the other hand, Android adds quite a bit to the Linux kernel, such as an improved power management that is well- suited for mobile battery-powered devices, a very fast interprocess communication mechanism based on Binder, and a mechanism for sand‐ boxing applications so they are isolated from one another.
  8. 8. The Stack| Native Layer The native layer is a set of code that is written mostly in C/C++. Unlike the Linux layer, the native layer is in the so- called user space. This part of the stack consists of couple of different parts, such as HAL, native libraries, native daemons, and native tools.
  9. 9. The Stack| HAL Android was designed to run on many different hardware configurations, and an An‐ droid app shouldn’t care about specifics of certain boards. To solve this problem, An‐ droid abstracts each major device driver with a shared native library. HAL basically provides the unified device driver model that is missing in standard Linux. This is its primary role. Secondarily, it has an additional feature of keeping the GPL code out of the user space. Basically, most device drivers are implemented as Linux kernel modules, and are often built into the kernel itself.
  10. 10. The Stack| Native Libraries The native libraries are C/C++ libraries. Their primary job is to support the Android Application Framework layer, which we’ll explore next. Some of these libraries are purpose-built for the Android OS, whereas others are often taken from the open source community in order to complete the operating system.
  11. 11. The Stack| Native Libraries Bionic An Android-specific implementation of libc library, derived from the BSD project and updated for needs of Android OS. Bionic also helps keep LGPL code out of user space.
  12. 12. The Stack| Native Libraries Binder A very fast inter-process communication mechanism that allows for one Android app to talk to another.
  13. 13. The Stack| Native Libraries Framework libraries Various libraries designed to support system services, such as location, media, package installer, telephony, WiFi, voip, and so on.
  14. 14. The Stack| Native Libraries Webkit A fast web-rendering engine used by Safari, Chrome, and other browsers.
  15. 15. The Stack| Native Libraries SQLite A full-featured SQL database that the Android app framework exposes to applica‐ tions.
  16. 16. The Stack| Native Libraries Apache Harmony An open source implementation of Java libraries.
  17. 17. The Stack| Native Libraries OpenGL 3D graphics libraries.
  18. 18. The Stack| Native Daemons Native daemons are executable code that usually runs to support some kind of system service. Examples of native daemons include: Service Manager (servicemanager) The umbrella process running all other framework services. It is the most critical native daemon. Radio interface layer daemon (rild) Responsible for supporting the telephony functionality via GSP or CDMA, usually.
  19. 19. The Stack| Native Daemons Installation daemon (installd) Supports management of apps, including installation, upgrades, as well as granting of permissions. Media server (mediaserver) Supports camera, audio, and other media services. Android Debug Bridge (adbd) Supports developer connectivity from your PC to the device (including the emulator) so that you can develop apps for Android.
  20. 20. The Stack| Native Tools Native tools include many standard Linux command-line tools, as well as the init process that is responsible for starting all the native daemons, among other things. Like most other operating systems, Android has a command-line shell where developers can poke around the system. On Android, developers access this shell via ADB, which we’ll go over later. However, if you are an experienced Linux user, you’ll quickly notice that the set of commands available in the standard Android release is far smaller than other typical Linux distributions. That’s because Android uses toolbox to support most of these command-line tools, such as cd, ls, ps, top, df, and so on. If you are used to Linux, do not expect to find grep, vi, less, more, or any other of the common developer tools.
  21. 21. The Stack| Dalvik Dalvik is a purpose-built virtual machine designed specifically for Android. The Java virtual machine (VM) was designed to be a one-size-fits-all solution, and the Dalvik team felt it could do a better job by focusing strictly on mobile devices. It looked at which constraints specific to a mobile environment are least likely to change in the future. One of these is the limited battery life, and the other is the size of ever-shrinking mobile devices. Dalvik was built from the ground up to address those constraints.
  22. 22. The Stack| Android and Java In Java, you write your Java source file, compile it into Java byte code using the Java compiler, and then run this byte code on the Java VM. In Android, things are different. You still write the Java source file, and you still compile it to Java byte code using the same Java compiler. But at that point, you recompile it once again to Dalvik byte code using the Dalvik compiler. It is this Dalvik byte code that is then executed on the Dalvik VM.
  23. 23. Stack Jackson F. De A. Mafra Curso: Desenvolvimento Mobile Android

×