You are on page 1of 15

Semester Project Documentation

Operating System

Submitted To Sir. Ejaz Gul

Topic: Google Android Operating System

24th May 2011

and Apple stroked market with iPhone. created in Java.5. Intel. The entire world was waiting for the response from Google with visionary Gphone. As OHA stands for open mobile platform. Motorola. OHA came with better solution ± Google Android ± first truly open mobile phone platform based on Linux. based on the software development for mobile phones. TMobile and other mobile operators. which is about to declare not a single Gphone. software and other Companies. Microsoft. This strategy. It consisted of 34 grand members. with clear and simple user interface and applications. gives mobile operators and device manufacturers significant freedom and flexibility to design products. NVIDIA. a great race has started between OHA and main competitors Apple. such as Google itself. which was acquired by Google for unknown amount of money on July 2005. Symbian with over 110 million smartphones released OSv.0 version with full updated Office Mobile and other features.The Birth of Android: There was a small company Android Inc. .9. As the experienced team started to work hardly in Google Campus. the Open Handset Alliance (OHA) was created to develop open standards for mobile devices. Microsoft launched Windows Mobile 6. but to put Android into existing and new mobiles devices and to make thousands of Gphones. Symbian and others. handset manufacturers. a single mobile device which could compete with iPhone and other mobile phones. it was a first serious sign about Google entering mobile phone market. In 2007.

³Android is built on the open Linux Kernel. or any of the applications. They can all be built to have equal access to a phone's capabilities providing users with a broad spectrum of applications and services. Furthermore.Android from above: y Openness:³Android was built from the ground-up to enable developers to create compelling mobile applications that take full advantage of all a handset has to offer. y Breaking down application boundaries :³Android breaks down the barriers to building new and innovative applications. For example. The system would then recognize that there is more than one application that wants to handle that Intent and ask the user to choose which one he or she would like to handle the Intent. which is a register based virtual machine.´ One can simply listen on that Intent by writing about 5 lines of definitions. the style of the dialer. They can even instruct their phones to use their favorite photo viewing application to handle the viewing of all photos. For example. providing no more of Google¶s default application to the user. as a developer you can do everything. up to replacing even the HOME-Screen of your device. allowing developers to create richer and more cohesive experiences for users. it can be liberally extended to incorporate new cutting edge technologies as they emerge. to be an important part of the Android platform.´ Here Google is talking of the so called Dalvik virtual machine (DalvikVM). One could easily create a fully customized operating system within weeks. sending text messages. With devices built on the Android Platform.´ This is true. It is built to be truly open. In the words ³register based´ we find the first difference to normal Java virtual machines (JVM) which are stack based y All applications are created equal :³Android does not differentiate between the phone's core applications and third-party applications. users will be able to fully tailor the phone to their interests. The platform will continue to evolve as the developer community works together to build innovative mobile applications. Android will be open source. from sending short messages with just 2 lines of code. an application could call upon any of the phone's core functionality such as making calls. designed and written by Dan Bornstein and some other Google engineers. They can swap out the phone's home screen. a developer can combine information from the web with data on an individual's mobile phone - . or using the camera. it utilizes a custom virtual machine that has been designed to optimize memory and hardware resources in a mobile environment.

and allows devices to communicate with one another enabling rich peer-to-peer social applications. Google Maps are so neat within Android as if it was just developed for Android.such as the user's contacts. . a developer could build an application that enables users to view the location of their friends and be alerted when they are in the vicinity giving them a chance to connect.´ Since the Web 2. One can integrate a fully zoom and drag enabled map by adding just 3(!) characters in the Java-Code of the Android-DefaultApplication and 3 lines of XML-Code. With Android.0 revolution.´ y Fast & easy application development :³Android provides access to a wide range of useful libraries and tools that can be used to build rich applications. Android includes a full set of tools that have been built from the ground up alongside the platform providing developers with high productivity and deep insight into their applications. In addition. Android enables developers to obtain the location of the device. calendar. For example. Android has brought developing to unknown speeds. making content rich applications within minutes is no more illusion. or geographic location . Google emphasizes Androids power of providing provide a more relevant user experience.

y SQLite Extremely small (~500kb) relational database management system. It is also supported by the Android core libraries.DEX format is done by included ³dx´ tool. Two pass layout loads a page without waiting for blocking elements. which come on Linux version. the framework is based on UNIX file system permissions that assure applications have only those abilities that mobile phone owner gave them at install time.DEX) that is created through build time post processing. Unlike other embedded mobile environments. y Optimized graphics Android has 2D graphics library and 3D graphics based on OpenGL ES 1. tables and data are stored. possibly we will see great applications like Google Earth and spectacular games like Second Life. GPS. which is integrated in Android. It is based on function calls and single file. It is also tuned to the CPU attributes. Android applications are all equal. y Dalvik virtual machine It is extremely low-memory based virtual machine. The Dalvik VM creates a special file format (. for instance. A great work was done for the developers to start work with Android using device . This simple design is more than suitable for a platform such as Android. They added a two pass layout and frame flattening. for instance. improved support for Camera and simply GSM telephony. The framework is supported by numerous open source libraries such as openssl. an applications which come with the phone are no different than those that any developer writes. These features increase speed and usability browsing the internet via mobile phone. Frame flattening converts founded frames into single one and loads into the browser. which was designed especially for Android to run on embedded systems and work well in low power situations. y Integrated browser Google made a right choice on choosing Web Kit as open source web browser. where all definitions. Conversion between Java classes and . From the point of security. the shooting legendary 3D game Doom was presented using Android on the mobile phone. sqlite and libc. a huge media and connections support. At this moment. such as external CSS or external JavaScript and after a while renders again with all resources downloaded to the device.Android Features y Application Framework It is used to write applications for Android.0. There are a number of hardware dependent features.

0 megapixels y gpsOne ± solution for GPS And lots of other. It helps to manage security.6 kernel. but in the second half of 2008 we should see mobile devices with stable version Qualcomm MSM 7200.emulator. memory management. the current kernel tree supports Qualcomm MSM 7200A chipsets.2 and Wi-Fi support y Digital audio support for mp3 and other formats y Support for Linux and other third-party operating systems y Java hardware acceleration and support for Java applications y Q camera up to 6. Android provides the support for the Qualcomm MSM7K chipset family. For instance. process management. the user should bring Linux in his mobile device as the main operating system and install all the drivers required in order to run it. Therefore. which includes major features: y WCDMA/HSUPA and EGPRS network support y Bluetooth 1. System Architecture Android Architecture is based on Linux 2. as Android just started its¶ journey to the mobile market. . network stack and other important issues. Finally. we are going to see much more features through the developed applications. tools for debugging and plugin for Eclipse IDE.

jar to . WebKit. Moreover. The media framework was provided by PacketVideo. which locates a single file for all operations related to database. By installing different applications. CPU. which are installed in the device. As I mentioned before. The View System generates a set of buttons and lists used in UI. It gives libraries for a playback and recording support for all the major media and static image files. It was designed specifically for Android running in limited environment. after this byte code becomes much more efficient to run on the small processors. OpenGL ES and SGL make a core of graphic libraries and are used accordingly for 3D and 2D hardware acceleration. After that.In the next level we can see a set of native libraries written in C/C++. At the top of Android Architecture we have all the applications. written in Java language. the same browser used by Apples¶ Safari. . optimized and smart mobile phone. Android uses SQLite. FreeType libraries are used to render all the bitmap and vector fonts. which converts generated byte code from . The Windows Manager is Java programming language abstraction on the top of lower level services that are provided by the Surface Manager. it is possible to use 2D and 3D graphics in the same application in Android. we have Application Framework. which are responsible for stable performance of various components. for instance. layout file descriptions and other external parts of the application. At the same level there is Android Runtime. It manages the access for different processes to compose 2D and 3D graphic layers. which are used by the final user. The Telephony Manager contains of a set of API necessary for calling applications. The Activity Manager manages the life circle of the applications and provides a common navigation backstack for applications. the utilities. For example. It is a toolkit that all applications use. Content Providers was built for Android to share a data with other applications. one of the members of OHA. where the main component Dalvik Virtual Machine is located. As the result. Other components like Notification manager is used to customize display alerts and other functions. it is possible to have multiple instances of Dalvik virtual machine running on the single device at the same time. bitmaps. ones which come with mobile device like Contacts or SMS box. IO and other tools. memory and data storage are the main issues. Surface Manager is responsible for composing different drawing surfaces on the mobile screen.dex file. was modified by Android in order to fit better in a small size screens. which are running in different processes. The Resource Manager is used to store localized strings. Android gives an integrated tool ³dx´. where the limited battery. For data storage. the contacts of people in the address book can be used in other applications too. The Package Manager keeps track of the applications. The Core libraries are written in Java language and contains of the collection classes. the user can turn his mobile phone into the unique. It has several components which I will discuss. it is extra light rational management system. or applications written by Google and any Android developer.

The major building blocks are these:  Activity  Intent Receiver  Service  Content Provider Activity Activities are the most common of the four Android building blocks. for Mac OSX and one for Linux. or when it's midnight. First step for Android developer is to decompose the prospective application into the components.broadcastIntent(). Your application does not have to be running for its intent receivers to be called. Android retains history stacks for each application launched from the home screen.xml. Each activity is implemented as a single class that extends the Activity base class. but you can also register them from code using Context. for example. . Moving to another screen is accomplished by a starting a new activity.Application Building Blocks Google provides three versions of SDK: for Windows. Most applications consist of multiple screens. or when the data network is available.registerReceiver(). The user can navigate backward through previously opened screens in the history. When a new screen opens. when the phone rings. and other screens to review old messages or change settings. An activity is usually a single screen in your application. Screens can also choose to be removed from the history stack when it would be inappropriate for them to remain. a second screen to write the message to the chosen contact. Intent Receiver You can use an IntentReceiver when you want code in your application to execute in reaction to an external event. if necessary. the system will start your application. which are supported by the platform. Applications can also send their own intent broadcasts to others with Context. a text messaging application might have one screen that shows a list of contacts to send messages to. For example. Your class will display a user interface composed of Views and respond to events. when an intent receiver is triggered. In some cases an Activity may return a value to the previous activity ± for example an activity that lets the user pick a photo would return the chosen photo to the caller. The developer can use Android plugin for Eclipse IDE or other IDEs such as intelliJ. Intent receivers are also registered in AndroidManifest. Intent receivers do not display a UI. although they may display Notifications to alert the user if something interesting has happened. the previous screen is paused and put onto a history stack. Each of these screens would be implemented as an activity.

(You can learn more about the priority given to services in the system by reading Life Cycle of an Android Application. a SQLite database. In this case. For the music service. find a picture of him in his Picasa Album. Application Lifecycle In Android.) Note that you can connect to a service (and start it if it's not already running) with the Context. this might allow you to pause. In the following example I will display a process flow from the Android System point of view to get a clear idea how the applications behave. A content provider. you can communicate with it through an interface exposed by the service. send it via Email back to his friend and resume a talk. Therefore. rewind. there would probably be one or more activities that allow the user to choose songs and start playing them. However. Content Provider Applications can store their data in files. the media player activity could start a service using Context. A good example of this is a media player playing songs from a play list. preferences or any other mechanism that makes sense. however. The system will then keep the music playback service running until it has finished. A content provider is a class that implements a standard set of methods to let other applications store and retrieve the type of data that is handled by that content provider.Service A Service is code that is long-lived and runs without a UI. When connected to a service. Android is responsible to run and shut down correctly these processes when it is needed.startService() to run in the background to keep the music going. is useful if you want your application's data to be shared with other applications. In a media player application. every application runs in its own process. which gives better performance in security.bindService() method. protected memory and other benefits. . etc. the music playback itself should not be handled by an activity because the user will expect the music to keep playing even after navigating to a new screen. Let assume the possible scenario: A user talks to his friend via mobile phone and he is asked to browse the internet (a talk is hold for a moment).

there are 4 different applications and 4 different processes running. Firstly. before going to Web Browser application. as a user holds a talk and opens a web browser. but from the user point of view none of them are important. the state of the last activity is saved (W) . the system saves a Talk state T in order to remember that process: At this point. which contains the activity manager. as the user is talking to his friend. as Android manages CPU work and memory usage by itself. In the following stack we can see two processes running. the system creates a new process and new web browser activity is launched in it. Moreover.In this situation. the main system process and Talk application process. a specific Talk application is opened. It means the user can travel through the applications forward and back without thinking about how much memory is left or which processes are run at the time. Again.

The folder activity is launched in particular process: At this point. the user browses the internet. so it kills Web Browser process as it is not useful anymore and locates a new Email process instead: . He does not close a web browser. instead he opens a folder to find saved picture.After that.Therefore. as it was used previously and could be reused again. Now assume that the mobile phone is out of the memory and there is no room to create a new process for Email application. It can not destroy Folder process. The last state F is saved. the user finds his saved picture in the folder and he creates a request to open an Email application. finds his picture in Picasa album and saves it to particular folder. Android looks to kill a process.

Email application is popped out and the user sees a previous Folder application: Next. web browser process was killed previously so the system has to kill another process (in our case it is Email application process. Now he wants to go back to the Talk application and to resume a talk to his friend.The user opens Email application and sends a picture to his friend via email. In this example. Unfortunately. Because of the previously saved states. the user goes back to Web Browser application. this work is done fast and easily. which is not used anymore) in order to locate Web Browser process and manage the stack memory: .

that it does not matter how many applications and processes are active or how much available memory is left. Because of the saved states. Android it manages fast and without a user interaction. This example shows. . going back procedure is fast and useful. because it remembers previous activities and its views.Now the user comes back to the Talk application and resumes his talk with his friend.

send text messages or multi-media messages or make connections to the Internet during normal device use. the main problem is availability for viruses to pose as an application and do things like dial phone numbers. SecurityShield ±an integrated application that includes anti-virus. . Linux secure coding practice should successfully be built into the Android development process. Hence SMobile Systems is ready to notify and block these secure alerts. As a result. firewall and other mobile protection is up and ready to run on the Android operating system. By the prediction. anti-spam.Security Issues It is quite difficult to discuss all the security issues. as it connects to the internet. there is an expectation for exploitation and harm. It is possible for somebody to use the GPS feature to track a person¶s location without their knowledge. such as source code vulnerability for blackhat hackers. Stealthy Trojans hidden in animated images. Android mobile phone platform is going to be more secure than Apple¶s iPhone or any other device in the long run. as no Android phone is build yet. This foundation joins particular companies to develop an open mobile-device software platform. However. all these threats will be active for a long run. used for spying and identity theft. a member of Linux Mobile (LiMo) Foundation. open platform has its own disadvantages. Many of the companies listed in the LiMo Foundation have also become members of the Open Handset Alliance (OHA). particular viruses passed from friend to friend. And neither the Android phone nor other devices will prove to be the exception. In parallel with great opportunities for mobile application developers. One of them is security vendor McAfee. There are several solutions nowadays to protect Google phone from various attacks. Currently. But the truth is that it is not possible to secure your mobile device or personal computer completely. Another solution for such attacks is SMobile Systems mobile package.

com/docs/selinux-faq-fc3/ SELinux NSA's Open Source Security Enhanced Linux http://www.redhat.php?docid=21959[amp ]group_id=21266] Red Hat Knowledgebase IRC irc.html Books Tutorials and Help General Information Technology Community History .au/selinux/talks/ibmtu-2004/ Generic Writing SELinux policy HOWTO NSA SELinux FAQ http://www.redhat.html Integrating Flexible Support for Security Policies into the Linux Operating System (a history of Flask implementation in Linux) some of this material may only apply to specific releases of Red Hat Enterprise #rhel-selinux Quick history of Flask y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y The following references are pointers to additional information that is relevant to SELinux and Red Hat Enterprise Linux but beyond the scope of this guide.cs.cfm Implementing SELinux as a Linux Security Module http://www.sourceforge. Note that due to the rapid development of SELinux.cfm SELinux community page http://selinux.html Full background on Fluke http://www.tresys.nsa.cfm Fedora SELinux FAQ http://fedora. Tutorials and talks from Russell Coker http://www.cfm A Security Policy Configuration for the Security-Enhanced Linux An Overview of Object Classes and Permissions 745 NSA SELinux main website http://www. 2007 Understanding and Customizing the Apache HTTP SELinux Policy http://fedora. and Caplan Prentice SELinux by Example Mayer.php?docid=21959[amp ]group_id=21266 [