Android OS


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Home process saves its status. Mail is opened.
  • Particular mail(message) is opened from inbox. Mail’s state is saved.
  • By following link in mail we open it and browser application get started. Message state is saved.
  • Now we want to start another map process but memory is full, so one process need to be killed from system process as Browser is recently opened process and we need home process for navigation. Mail process is best choice to kill. So we kill it and save Browser process state.
  • Map process get started.
  • When we go back mail process again created through instance saved in system process.
  • kernel the kernel boots core kernel initialization memory and I/O areas are initialized interrupts are started, and the process table is initialized driver initialization kernel daemons (threads) are started root file system is mounted the first user-space process is started usually /init (note that other Linux systems usually start /sbin/init)
  • /init processes /init.rc and /init.<machine_name>.rc dalvik VM is started (zygote). See Android Zygote Startup several daemons are started: 1-rild - radio interface link daemon 2-vold - volume daemon (media volumes, as in file systems - nothing to do with audio volume) ADB ADB (Android Debug Bridge) is a tool that comes with the Android SDK that allows you to control and interface with your Android device. It is located in the tools folder when you unpack the SDK.
  • 1- init runs the C++ program /system/bin/app_process, and gives the resulting process the name "zygote"
  • Android OS

    1. 1. OS 09BCE050 Nitin Ramchandani
    2. 2. IntroductionWhat is Android? • A software platform and operating system for mobile devices • Based on the Linux kernel • Developed by Google and later the Open Handset Alliance (OHA) • Allows writing managed code in the Java language • Possibility to write applications in other languages and compiling it to native code. • At least 150,000 Application available in Android. • It run on java based and object- Oriented based application
    3. 3. Android History•Android Inc was founded in Oct 2003 by AndyRubin, Nick Sears, Chris White and Rich Miner.•Google acquired it in august 2005.•On November 5, 2007, the Open HandsetAlliance, a consortium of several companies whichinclude Broadcom Corporation, Google, HTC,Intel, T-Mobile and Texas Instruments unveileditself.
    4. 4. What is the Open Handset Alliance (OHA)? • Devoted to advancing open standards for mobile devices • Develop technologies that will significantly lower the cost of developing and distributing mobile devices and services.LicenseAndroid is under of the Apache Software License (ASL).
    5. 5. What is the Open Handset Alliance (OHA)? → Its a consortium of several companies
    6. 6. AndroidArchitecture
    7. 7. Linux Kernel•Android is built on LINUX kernel, but it is not theLINUX.•No native windowing system(X window system)•No glibc support•Does not support all set of standard GNUlibraries
    8. 8. Why LINUX?• Great memory and process management• Great permissions based security model• Proven driver model• Support for shared libraries• It’s already open source
    9. 9. • Power Management Based on the standard Linux Power Management, Android has its own component. •Application uses user space library to inform the framework about its constrains.. •Constraints are implemented using lock mechanism..
    10. 10. PARTIAL_WAKE_LOCK• CPU on, screen off, keyboard off• Cannot power down via power buttonSCREEN_DIM_WAKE_LOCK• CPU on, screen dim, keyboard offSCREEN_BRIGHT_WAKE_LOCK• CPU on, screen bright, keyboard offFULL_WAKE_LOCK• CPU on, screen on, keyboard bright
    11. 11. Binder•Driver to facilitate inter-process communication between applicationsand services..• A pool of threads is associated to each application to processincoming IPC•The driver performs mapping off object between two processes•“Binder” uses an object reference as an address in a process’s memoryspace
    12. 12. Libraries• Media Libraries - based on PacketVideos OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG• LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view
    13. 13. • SGL - the underlying 2D graphics engine• 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer• FreeType - bitmap and vector font rendering• SQLite - a powerful and lightweight relational database engine available to all applications
    14. 14. Surface managerProvides a system-wide surface “composer” to renderall the surfaces in a frame buffer •Can combined 2D and 3D surfaces •Can use OpenGL ES and 2D hardware accelerator for its compositions
    15. 15. Audio Manager•Handle several types of devices (headphone,ear piece…)•Redirects audio stream to the specified output
    16. 16. Hardware Abstraction LibrariesDefines the interface that Android requireshardware “drivers” to implement.•Set of standardized APIs the developer will have toimplement•Available for all the components a manufacturer canintegrate on its Android platform
    17. 17. Android RuntimeDalvik VM• Designed for embedded environment• Supports multiple VM processesper device.• Highly CPU-optimized byte codeinterpreter.• Uses run time memory very efficiently.• Run optimized file format(.dex) Dalvik bytecode.• Java .class/.jar are converted to .dex at build time.
    18. 18. Core Libraries• Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language
    19. 19. Application Framework•A Notification Manager that enables allapplications to display custom alerts in the statusbar•An Activity Manager that manages the lifecycle ofapplications and provides a common navigationbackstack
    20. 20. • A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser• Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data• A Resource Manager providing access to non-code resources such as localized strings, graphics, and layout files
    21. 21. Applications• Built in and user apps• Can replace built in apps
    22. 22. Application Lifecycle• In android every application runs in their own process.• Processes are started or stopped as needed to run application components.• A process may be killed to reclaim resources.
    23. 23. Android Startup•Similar to most Linux-based systems atstartup, the boot-loader loads the Linuxkernel and starts the init process
    24. 24. Init starts Linux daemons, including:• USB Daemon (usbd) to manage USBconnections• Android Debug Bridge (adbd) to manage ADBconnections• Debugger Daemon (debuggerd) to managedebug processes requests (dump memory,etc.)• Radio Interface Layer Daemon (rild) tomanage communication with the radio Initusbd
    25. 25. Init process starts the zygote process:• A nascent process which initializes a Dalvik VMinstance• Loads classes and listens on socket for requests tospawn VMs• Forks on request to create VM instances formanaged processes• Copy-on-write to maximize re-use and minimizefootprint
    26. 26. •Init starts runtime process:• Initializes Service Manager – the context managerfor Binder that handles service registration andlookup• Registers Service Manager as default contextmanager for Binder services
    27. 27. •Runtime process sends request for Zygoteto start System Service
    28. 28. Runtime process sends request for Zygote to startSystem Server• Zygote forks a new VM instance for the SystemService process and starts the service
    29. 29. System Service starts the native systemservers, including: • Surface Flinger` • Audio Flinger
    30. 30. •Native system servers register with ServiceManager as IPC service targets:
    31. 31. •System Service starts the Android managed services
    32. 32. Android managed Services register with Service Manager:
    33. 33. •After system server loads all services, the system is ready
    34. 34. •Each subsequent application is launched in itʼ s own process
    35. 35. Activity cycle
    36. 36. • onCreate(Bundle): This is called when the activity firststarts up.•onStart( ): This indicates the activity is about to bedisplayed to the user.• onResume( ): This is called when your activity can startinteracting with the user. This is a good place to startanimations and music.• onPause( ): This runs when the activity is about to gointo the background, usually because another activity hasbeen launched in front of it. This is where you should saveyour program’s persistentstate, such as a database record being edited.
    37. 37. • onStop( ): This is called when your activity is no longervisible to the user and it won’t be needed for a while. Ifmemory is tight, onStop( ) may never be called (the systemmay simply terminate your process).• onRestart( ): If this method is called, it indicates youractivity is being redisplayed to the user from a stopped state.• onDestroy( ): This is called right before your activity isdestroyed. If memory is tight, onDestroy( ) may never becalled (the system may simply terminate your process)..
    38. 38. •onSaveInstanceState(Bundle): Android will call thismethod to allow the activity to save per-instance state,such as a cursor position within a text field. Usually youwon’t need to override it because the defaultimplementation saves the state for all your user interfacecontrols automatically.• onRestoreInstanceState(Bundle): This is called whenthe activity is being reinitialized from a state previouslysaved by the onSaveInstanceState( ) method. The defaultimplementation restores the state of your user interface.
    39. 39. Android v/sother Mobile os
    40. 40. Apple v/sAndroid
    41. 41. • The Apple iPhone comes with an expansive set of applications, available for free or for a small fee; the Google Android comes with a smaller package of applications.• The Apple iPhone comes with a feature to alert the user of any missed instances, though this feature forces the user to prematurely end whatever action he is performing; the Google Android comes with a drag and drop screen that alerts the user of any occurrences ,but allows him to continue his actions.• Apple controls all of its hardware, and it is therefore simple to perform the necessary accessory maintenance; Google’s Android is simply a platform that functions on different platforms, and doesn’t allow for easy accessory support.
    42. 42. Android v/ssyMbiAn
    43. 43. 1. Android is fairly new and has a smaller market share than the older Symbian3. Android is designed around touch capable devices while Symbian is designed around keypad devices5. Symbian is somewhat outdated while Android is constantly updated7. Android is used by many phone manufacturers while Symbian is almost exclusive to Nokia.
    44. 44. Android v/sblAckberry
    45. 45. 1. Android smartphones are more apps-centered while BlackBerry smartphones cater more to business.2. BlackBerry has a good security system while the Android’s is questionable.3. Android has plenty of apps that appeal to the geekier nature while BlackBerry was created for the business people in the corporate world.4. BlackBerry was the pioneering smartphone. Android just followed through.5. BlackBerry was first in email transferring while Android was the first in customizing.
    46. 46. 1. Windows Mobile is from Microsoft while Android was developed by Google.2. Windows Mobile is proprietary while Android is open source.3. Windows Mobile is relatively old and pretty established while the Android is pretty new.4. There are a lot of phones that uses Windows Mobile while there are only a handful running Android.5. There are a lot more programs available for Windows Mobile compared to Android.
    47. 47. Building Blocks• Activities• Intent• Services• Content providers
    48. 48. Activities•Activity is an User Interface Screen.•An application may have two or more activities tohandle different phases of program.For e.g. opening page, menu page, etc•Activity is responsible for saving its own state sothat it can be restored later as part of theapplication life cycle.
    49. 49. Intents•Intent is a mechanism for describing a specific actionsuch as pick a photo.•Basically we register a activity to handle a Intent.Content Provider•A content provider is a set of data wrapped up in acustom API to read and write it. This is the best wayto share global data between applications.•Google provide content provider for contacts.
    50. 50. Services•A service is a task that runs in the background withoutthe user’s direct interaction, similar to a Unix daemon.For e.g. we can have Music player program playing inbackground even if we are browsing other programs.
    51. 51. thAnk you