260 likes | 267 Vues
Discover the Android software stack for mobile devices, including its operating system, middleware, applications, and runtime details. Learn about the OHA, market share, app framework, libraries, and more.
E N D
Android Introduction Platform Overview @2011 Mihail L. Sichitiu
What is Android? • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. @2011 Mihail L. Sichitiu
OHA (Open Handset Alliance) A business alliance consisting of 47 companies to develop open standards for mobile devices @2011 Mihail L. Sichitiu
Market Share (2014 Q2) @2011 Mihail L. Sichitiu
Architecture @2011 Mihail L. Sichitiu
Android S/W Stack - Application • Android provides a set of core applications: • Email Client • SMS Program • Calendar • Maps • Browser • Contacts • Etc • All applications are written using the Java language. @2011 Mihail L. Sichitiu
Android S/W Stack – App Framework • Enabling and simplifying the reuse of components • Developers have full access to the same framework APIs used by the core applications. • Users are allowed to replace components. @2011 Mihail L. Sichitiu
Android S/W Stack – App Framework (Cont) Features @2011 Mihail L. Sichitiu
Android S/W Stack - Libraries Including a set of C/C++ libraries used by components of the Android system Exposed to developers through the Android application framework @2011 Mihail L. Sichitiu
Android S/W Stack - Runtime • Core Libraries • Providing most of the functionality available in the core libraries of the Java language • APIs • Data Structures • Utilities • File Access • Network Access • Graphics • Etc @2011 Mihail L. Sichitiu
Android S/W Stack – Runtime (Cont) • Dalvik Virtual Machine • Providing environment on which every Android application runs • Each Android application runs in its own process, with its own instance of the Dalvik VM. • Dalvik has been written such that a device can run multiple VMs efficiently. • Unlike java VM, Dalvik is designed for resource-constrained environments @2011 Mihail L. Sichitiu
Android S/W Stack – Runtime (Cont) • Dalvik Virtual Machine (Cont) • Executing the Dalvik Executable (.dex) format • .dex format is optimized for minimal memory footprint. • Compilation @2011 Mihail L. Sichitiu
Android S/W Stack – Runtime (Cont) • Android Runtime (ART) • ART is a new Android runtime being introduced experimentally in the 4.4 release. • Ahead-of-time (AOT) compilation • Improved garbage collection • Development and debugging improvements @2011 Mihail L. Sichitiu
Android S/W Stack – Linux Kernel • Providing an abstraction layer between the H/W and the rest of the S/W stack • Relying on Linux Kernel 2.6-3.4 for core system services • Memory and Process Management and Threading • Network Stack • File & Network IO • Driver Model • Security @2011 Mihail L. Sichitiu
Android S/W Stack – Linux Kernel • Linux Kernel – Android Specific Components • Power Management • Android Shared Memory • Low Memory Killer • Interprocess Communication @2011 Mihail L. Sichitiu
Application Fundamentals @2011 Mihail L. Sichitiu
Applications • Written in Java (it’s possible to write native code – will not cover that here) • Good separation (and corresponding security) from other applications: • Each application runs in its own process • Each process has its own separate VM • Each application is assigned a unique Linux user ID – by default files of that application are only visible to that application (can be explicitly exported) @2011 Mihail L. Sichitiu
Application Components • Activities – visual user interface focused on a single thing a user can do • Services – no visual interface – they run in the background • Broadcast Receivers – receive and react to broadcast announcements • Content Providers – allow data exchange between applications @2011 Mihail L. Sichitiu
Activities • Basic component of most applications • Most applications have several activities that start each other as needed • Each is implemented as a subclass of the base Activity class @2011 Mihail L. Sichitiu
Activity Lifecycle @2011 Mihail L. Sichitiu
Services • Does not have a visual interface • Runs in the background indefinitely • Examples • Network Downloads • Playing Music • TCP/UDP Server • You can bind to a an existing service and control its operation @2011 Mihail L. Sichitiu
Broadcast Receivers • Receive and react to broadcast announcements • Extend the class BroadcastReceiver • Examples of broadcasts: • Low battery, power connected, shutdown, timezone changed, etc. • Other applications can initiate broadcasts @2011 Mihail L. Sichitiu
Content Providers • Makes some of the application data available to other applications • It’s the only way to transfer data between applications in Android (no shared files, shared memory, pipes, etc.) • Extends the class ContentProvider; • Other applications use a ContentResolver object to access the data provided via a ContentProvider @2011 Mihail L. Sichitiu
Android Manifest • Its main purpose in life is to declare the components to the system: <?xml version="1.0" encoding="utf-8"?><manifest . . . > <application . . . > <activity android:name="com.example.project.FreneticActivity" android:icon="@drawable/small_pic.png" android:label="@string/freneticLabel" . . . > </activity> . . . </application></manifest> @2011 Mihail L. Sichitiu
Android ADT – Eclipse IDE @2011 Mihail L. Sichitiu
Android Studio - IntelliJ IDE @2011 Mihail L. Sichitiu