Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating Systems Case Study

Similar presentations


Presentation on theme: "Operating Systems Case Study"— Presentation transcript:

1 Operating Systems Case Study
Android Operating Systems Case Study

2 Topics History of Android Activity Manager Architecture
Threads and States Virtual Memory

3 What is it? Android is a mobile operating system developed by Google, based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets. Android's user interface is mainly based on direct manipulation, using touch gestures that loosely correspond to real-world actions, such as swiping, tapping and pinching, to manipulate on-screen objects, along with a virtual keyboard for text input.

4 History of Android Android, Inc. was founded in Palo Alto, California in October 2003 In July 2005, Google acquired Android Inc. for at least $50 million. On November 5, 2007, the Open Handset Alliance (Google, Samsung, Sprint, Nextel, T-Mobile) announced open standards for mobile devices and that Android was it’s first product (mobile device platform built on the Linux Kernel)

5 Android – Activity Manager
Zygote is a special process that launches applications Users request an application launch by tapping the screen The home screen is the only application listening onClick() A Handler through the Binder calls the Activity Manager The Activity Manager receives the request to startActivity()  Zygote forks itself and starts a new VM to run the app. It does this via startViaZygote() method which will open a connection to the Zygote socket (/dev/socket/zygote) Source: anatomyofandroid.com

6 Android Activity Manager Flow

7 Android Architecture

8 Threads When an application is launched, the system creates a thread of execution for the application, called "main. This thread is very important because it is in charge of dispatching events to the appropriate user interface widgets, including drawing events. It is also the thread in which your application interacts with components from the Android UI toolkit (called UI thread)

9 Worker Threads Because of the single thread model, it's vital to the responsiveness of your application's UI that you do not block the UI thread. If you have operations to perform that are not instantaneous, you should make sure to do them in separate threads ("background" or "worker" threads). public void onClick(View v) { new Thread(new Runnable() { public void run() { Bitmap b = loadImageFromNetwork(" mImageView.setImageBitmap(b); } }).start();

10 Processes in order of importance
Foreground process – required for what the user is currently doing. Visible process – does work that user is currently aware of Service process - is one holding a Service that has been started with the startService() method. Cached process is one that is not currently needed, so the system is free to kill it when memory is needed elsewhere. Kept in a LRU list

11 Virtual Memory in Android
Android doesn't use virtual memory by default. Transparently writing pages of memory to flash storage is bad for battery life (and for the life of your flash storage, which can only handle a certain number of writes) and performance, especially since the application has no control over which parts of memory are "paged out". Instead, Android manages memory using the same mechanism it uses to decide when to terminate apps that are no longer running. When it finds it needs to free up some RAM, it chooses an app that was cached (one that isn't currently in use). It terminates this app to free its RAM, but first, it gives that app's activities a chance to save some state by writing it to storage.

12 Virtual Memory in Android
Of course, Android is based on Linux, and uses virtual memory in other ways not visible to the user. Android systems must have an MMU, so apps use virtual, not physical, addresses. Note: You can enable swap on Android. It's not recommended to do so in most cases, because it defeats the memory-saving mechanism described above. Adding a swap partition will make the battery run down faster, wear out your flash storage faster, and make the system less responsive

13 Ex) Samsung Galaxy S7 Specs
Display 5.1 inch Display (1440 X 2560 Resolution) Processor Octa Core Snapdragon 820, Exynos 8890, bit Chipset Dimensions X 69.6 X 7.9 mm, 152 grams OS Android v6.0 (Marshmallow OS) RAM 4 GB Memory 32 / 64 GB, Micro SD up to 200 GB Networking 2G, 3G, 4G LTE, HSPA, GSM support v Bluetooth, NFC, Wi-Fi, A-GPS, GLONASS Release date March 11, 2016


Download ppt "Operating Systems Case Study"

Similar presentations


Ads by Google