Thứ Tư, 23 tháng 12, 2009

Android: Introduction

What is Android ?
Is a Platform:
  • §Built on Linux kernel.
  • §For open handset devices.
  • §Open-source libraries for Web, SQLLite, OpenGL, SSL,…
Also included Middle-ware
  • §Base on C/C++ Linux kernel.
  • §Fully support for Java developer (by JNI).
  • §Use XML for flexible UI and Effect definition.
And is Key Applications with Android Software Stack
  • §Have a lot of applications fully support for PIM. (Contacts, Calendar, Phone, SMS Manager, Browser, Player, ..)

Android Application Software Stack
Slide 4
Linux Kernel 2.6 -Set of C/C++ open-source libraries had been converted to Java protocol for Java developer. -Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications -Android runtime with multi Dalvik VM instances and GC,.. Each Android Application (process) have it own Dalvik VM. -Application Framework: include so many services for management: - Content Providers: share data between components or applications. - Activity Manager: manages the lifecycle of applications and provides a common navigation back stack. (based on Android Software Stack) - Window Manager: - View System: Create interfaces for user. - Package Manager: manage installed applications, packages, librabries. - Telephony Manager: Phone’s services. - Resource Manager: providing access to non-code resources (strings, graphics, and layout files) - Location Manager: - Notification Manager: display custom alerts in the status bar. -APIs (JDK or NDK) for fully interacted with services and devices.
The Dalvik Virtual Machine
The Dalvik VM is a registered-base virtual machine. It is optimized for low memory requirements, and is designed to allow for multiple VM instances to run at once, relying on underlying operating system for process isolating, memory management and threading support. Dalvik use .dex files format:
A dx tool will compile Java class files to. dex file format. Multi classes are included in one .dex file, alls duplicate string or resource will be reduced for smallest size. Java byte codes are also converted into a alternative instruction set used by Dalvik VM. Dalvik executables may be modified again when they get installed onto a device.
Dalvik VM was slimmed down to use less space. Dalvik has modified constant pool to use only 32-bit indexes to simplify the interpreter. Dalvik VM use it own byte code, not Java byte code. The name “Dalvik” is belong to the name of a village in Iceland where Dan Bornstein’s ancestors lived. -The executable code on Android, as a result in Dalvik VM, is based not on Java byte code, but on .dex files format instead. -The java compiled class or .jar standard executable file are not compatible with Android. Why no “JIT” : Google has fine-tuned the garbage collection in the Dalvik VM, but it has chosen to omit a just-in-time (JIT) compiler, in this release at least. The company can justify this choice because many of Android’s core libraries, including the graphics libraries, are implemented in C and C++. For example, the Java graphics APIs are actually thin wrapper classes around the native code using the Java Native Interface (JNI). Similarly, Android provides an optimized C-based native library to access the SQLite database, but this library is encapsulated in a higher-level Java API. Because most of the core code is in C and C++, Google reasoned that the impact of JIT compilation would not be significant.

Không có nhận xét nào:

Đăng nhận xét