Upload

Published on May 2016 | Categories: Documents | Downloads: 35 | Comments: 0 | Views: 356
of 15
Download PDF   Embed   Report

Comments

Content

Semester Project Documentation

Operating System

Submitted To Sir. Ejaz Gul

Topic: Google Android Operating System

24th May 2011

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

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. It is built to be truly open. For example, an application could call upon any of the phone's core functionality such as making calls, sending text messages, or using the camera, allowing developers to create richer and more cohesive experiences for users.´ This is true, as a developer you can do everything, from sending short messages with just 2 lines of code, up to replacing even the HOME-Screen of your device. One could easily create a fully customized operating system within weeks, providing no more of Google¶s default application to the user. ³Android is built on the open Linux Kernel. Furthermore, it utilizes a custom virtual machine that has been designed to optimize memory and hardware resources in a mobile environment. Android will be open source; it can be liberally extended to incorporate new cutting edge technologies as they emerge. The platform will continue to evolve as the developer community works together to build innovative mobile applications.´ Here Google is talking of the so called Dalvik virtual machine (DalvikVM), which is a register based virtual machine, designed and written by Dan Bornstein and some other Google engineers, to be an important part of the Android platform. 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. They can all be built to have equal access to a phone's capabilities providing users with a broad spectrum of applications and services. With devices built on the Android Platform, users will be able to fully tailor the phone to their interests. They can swap out the phone's home screen, the style of the dialer, or any of the applications. They can even instruct their phones to use their favorite photo viewing application to handle the viewing of all photos.´ One can simply listen on that Intent by writing about 5 lines of definitions. 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. y Breaking down application boundaries :³Android breaks down the barriers to building new and innovative applications. For example, a developer can combine information from the web with data on an individual's mobile phone -

such as the user's contacts, calendar, or geographic location - to provide a more relevant user experience. With Android, 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.´ 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. For example, Android enables developers to obtain the location of the device, and allows devices to communicate with one another enabling rich peer-to-peer social applications. In addition, 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.´ Since the Web 2.0 revolution, making content rich applications within minutes is no more illusion. Android has brought developing to unknown speeds. Google emphasizes Androids power of providing location-based-services. Google Maps are so neat within Android as if it was just developed for Android. 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.

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

emulator, tools for debugging and plugin for Eclipse IDE. Finally, as Android just started its¶ journey to the mobile market, we are going to see much more features through the developed applications.

System Architecture

Android Architecture is based on Linux 2.6 kernel. It helps to manage security, memory management, process management, network stack and other important issues. Therefore, 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. Android provides the support for the Qualcomm MSM7K chipset family. For instance, the current kernel tree supports Qualcomm MSM 7200A chipsets, but in the second half of 2008 we should see mobile devices with stable version Qualcomm MSM 7200, which includes major features: y WCDMA/HSUPA and EGPRS network support y Bluetooth 1.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.0 megapixels y gpsOne ± solution for GPS And lots of other.

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

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

Service A Service is code that is long-lived and runs without a UI. A good example of this is a media player playing songs from a play list. In a media player application, there would probably be one or more activities that allow the user to choose songs and start playing them. However, 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. In this case, the media player activity could start a service using Context.startService() to run in the background to keep the music going. The system will then keep the music playback service running until it has finished. (You can learn more about the priority given to services in the system by reading Life Cycle of an Android Application.) Note that you can connect to a service (and start it if it's not already running) with the Context.bindService() method. When connected to a service, you can communicate with it through an interface exposed by the service. For the music service, this might allow you to pause, rewind, etc. Content Provider Applications can store their data in files, a SQLite database, preferences or any other mechanism that makes sense. A content provider, however, is useful if you want your application's data to be shared with other applications. 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.

Application Lifecycle
In Android, every application runs in its own process, which gives better performance in security, protected memory and other benefits. Therefore, Android is responsible to run and shut down correctly these processes when it is needed. 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. 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), find a picture of him in his Picasa Album, send it via Email back to his friend and resume a talk.

In this situation, there are 4 different applications and 4 different processes running, but from the user point of view none of them are important, as Android manages CPU work and memory usage by itself. 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. Firstly, as the user is talking to his friend, a specific Talk application is opened, which contains the activity manager. In the following stack we can see two processes running, the main system process and Talk application process. Moreover, before going to Web Browser application, the system saves a Talk state T in order to remember that process:

At this point, as a user holds a talk and opens a web browser, the system creates a new process and new web browser activity is launched in it. Again, the state of the last activity is saved (W)

After that, the user browses the internet, finds his picture in Picasa album and saves it to particular folder. He does not close a web browser, instead he opens a folder to find saved picture. The folder activity is launched in particular process:

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

The user opens Email application and sends a picture to his friend via email. Now he wants to go back to the Talk application and to resume a talk to his friend. Because of the previously saved states, this work is done fast and easily. In this example, Email application is popped out and the user sees a previous Folder application:

Next, the user goes back to Web Browser application. Unfortunately, web browser process was killed previously so the system has to kill another process (in our case it is Email application process, which is not used anymore) in order to locate Web Browser process and manage the stack memory:

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

Security Issues
It is quite difficult to discuss all the security issues, as no Android phone is build yet. By the prediction, Android mobile phone platform is going to be more secure than Apple¶s iPhone or any other device in the long run. There are several solutions nowadays to protect Google phone from various attacks. One of them is security vendor McAfee, a member of Linux Mobile (LiMo) Foundation. This foundation joins particular companies to develop an open mobile-device software platform. Many of the companies listed in the LiMo Foundation have also become members of the Open Handset Alliance (OHA). As a result, Linux secure coding practice should successfully be built into the Android development process. However, open platform has its own disadvantages, such as source code vulnerability for blackhat hackers. In parallel with great opportunities for mobile application developers, there is an expectation for exploitation and harm. Stealthy Trojans hidden in animated images, particular viruses passed from friend to friend, used for spying and identity theft, all these threats will be active for a long run.

Another solution for such attacks is SMobile Systems mobile package. SecurityShield ±an integrated application that includes anti-virus, anti-spam, firewall and other mobile protection is up and ready to run on the Android operating system. Currently, the main problem is availability for viruses to pose as an application and do things like dial phone numbers, send text messages or multi-media messages or make connections to the Internet during normal device use. It is possible for somebody to use the GPS feature to track a person¶s location without their knowledge. Hence SMobile Systems is ready to notify and block these secure alerts. But the truth is that it is not possible to secure your mobile device or personal computer completely, as it connects to the internet. And neither the Android phone nor other devices will prove to be the exception.

References:
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. Note that due to the rapid development of SELinux, some of this material may only apply to specific releases of Red Hat Enterprise Linux. SELinux by Example Mayer, MacMillan, and Caplan Prentice Hall, 2007 Understanding and Customizing the Apache HTTP SELinux Policy http://fedora.redhat.com/docs/selinux-apache-fc3/ Tutorials and talks from Russell Coker http://www.coker.com.au/selinux/talks/ibmtu-2004/ Generic Writing SELinux policy HOWTO https://sourceforge.net/docman/display_doc.php?docid=21959[amp ]group_id=21266 [https://sourceforge.net/docman/display_doc.php?docid=21959[amp ]group_id=21266] Red Hat Knowledgebase http://kbase.redhat.com/ NSA SELinux main website http://www.nsa.gov/selinux/ NSA SELinux FAQ http://www.nsa.gov/selinux/info/faq.cfm Fedora SELinux FAQ http://fedora.redhat.com/docs/selinux-faq-fc3/ SELinux NSA's Open Source Security Enhanced Linux http://www.oreilly.com/catalog/selinux/ An Overview of Object Classes and Permissions 745 http://www.tresys.com/selinux/obj_perms_help.html Integrating Flexible Support for Security Policies into the Linux Operating System (a history of Flask implementation in Linux) http://www.nsa.gov/selinux/papers/slinux-abs.cfm Implementing SELinux as a Linux Security Module http://www.nsa.gov/selinux/papers/module-abs.cfm A Security Policy Configuration for the Security-Enhanced Linux http://www.nsa.gov/selinux/papers/policy-abs.cfm SELinux community page http://selinux.sourceforge.net IRC irc.freenode.net, #rhel-selinux Quick history of Flask http://www.cs.utah.edu/flux/fluke/html/flask.html Full background on Fluke http://www.cs.utah.edu/flux/fluke/html/index.html

Books

Tutorials and Help

General Information

Technology

Community

History

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close