Google Android

Based on android-sdk_2.2

Mobile Computing

Bruce Scharlau, University of Aberdeen, 2010

Android is part of the ‘build a better phone’ process
Open Handset Alliance produces Android

Comprises handset manufacturers, software firms, mobile operators, and other manufactures and funding companies

Bruce Scharlau, University of Aberdeen, 2010

com/wp-content/uploads/2010/06/May-2010-AdMob-Mobile-Metrics-Highlights.Android is growing Uneven distribution of OS by regions Does not include iTouch or iPad.admob. University of Aberdeen. 2010 . as not smartphones http://metrics.pdf Bruce Scharlau.

University of Aberdeen. 2010 http://code.html .com/android/goodies/index. sort of… Bruce Scharlau.Android makes mobile Java easier

os.layout.Bundle.onCreate(icicle). 2010 } public class HelloActivity extends Activity { public HelloActivity() { } @Override public void onCreate(Bundle icicle) { super. } Bruce Scharlau. import android. University of Aberdeen.Activity.Android applications are written in Java package com. import android. setContentView(R.hello_activity).google.

2010 . University of Aberdeen.Android applications are compiled to Dalvik bytecode Write app in Java Compiled in Java Transformed to Dalvik bytecode Loaded into Dalvik VM Linux OS Bruce Scharlau.

2010 . University of Aberdeen.The Dalvik runtime is optimised for mobile applications Run multiple VMs efficiently Each app has its own VM Minimal memory footprint Bruce Scharlau.

2010 . University of Aberdeen.Android has many components Bruce Scharlau.

2 Bruce Scharlau.Can assume that most have android 2. 2010 http://developer. University of Aberdeen.1 or .com/resources/dashboard/platform-versions.

2010 . University of Aberdeen.Android has a working emulator Bruce Scharlau.

2010 .All applications are written in Java and available to each other Android designed to enable reuse of components in other applications Each application can publish its capabilities which other apps can use Bruce Scharlau. University of Aberdeen.

and even an embeddable web browser Content Providers that enable applications to access data from other applications (such as Contacts). text boxes. 2010 . or to share their own data An Activity Manager that manages the life cycle of applications and provides a common navigation backstack A Notification Manager that enables all apps to display custom alerts in the status bar A Resource Manager. graphics. and layout files Bruce Scharlau. grids. providing access to noncode resources such as localized strings. University of Aberdeen.Android applications have common structure Views such as lists. buttons.

and can be shared between apps – database. and shared preferences (hash map) used by group of applications Activity is the presentation layer of your app: there will be one per screen. file. University of Aberdeen. and trigger events Bruce Scharlau. and the Views provide the UI to the activity Intents specify what specific action should be performed Services run in the background and have no UI for the user – they will update data.Android applications have common structure Broadcast receivers can trigger intents that start an application Data storage provide data for your apps. 2010 .

University of Aberdeen. 2010 .There is a common file structure for applications code files images UI layouts Autogenerated resource list constants Bruce Scharlau.

University of Aberdeen. 2010 Other applications .Standard components form building blocks for Android apps Notifications Has life-cycle Activity Views screen App to handle content Intents Service manifest Background app Like music player ContentProviders Bruce Scharlau.

University of Aberdeen.intent.intent.MAIN"/> <category android:name="android.The AndroidManifest lists application details <?xml version="1.HelloActivity"> <intent-filter> <action android:name="android. 2010 .LAUNCHER"/> </intent-filter> </activity> </application> Bruce Scharlau.action.helloactivity"> <application android:label="@string/app_name"> <activity android:name=".0" encoding="utf-8"?> <manifest xmlns:android="" package="

Activity is one thing you can do From fundamentals page in sdk Bruce Scharlau. University of Aberdeen. 2010 .

Written as action/data pairs such as: VIEW_ACTION/ACTION content://contacts/1 Bruce Scharlau. It is basically a passive data structure holding an abstract description of an action to be performed. University of Aberdeen.Intent provides late running binding to other apps It can be thought of as the glue between activities. 2010 .

might need to spawn their own thread so as to not block the application Bruce Scharlau. 2010 . University of Aberdeen.Services declared in the manifest and provide support Services run in the background: Music player providing the music playing in an audio application Intensive background apps.

2010 . University of Aberdeen. and the MP3 player should pause Bruce Scharlau.Notifications let you know of background events This way you know that an SMS arrived. or that your phone is ringing.

ContentProviders share data You need one if your application shares data with other applications This way you can share the contact list with the IM application If you don’t need to share data. then you can use SQLlite database Bruce Scharlau. 2010 . University of Aberdeen.

layout.UI layouts are in Java and XML setContentView(R.hello_activity). 2010 . University of Aberdeen. //will load the XML UI file Bruce Scharlau. 2010" package="com.myapp" > <uses-permission id="android.Security in Android follows standard Linux guidelines Each application runs in its own process Process permissions are enforced at user and group IDs assigned to processes Finer grained permissions are then granted (revoked) per operations <manifest xmlns:android="http://schemas.RECEIVE_SMS" /> </manifest> Bruce Scharlau. University of Aberdeen.

sample applications and lots of docs • Blog http://android-developers. University of Bruce Scharlau.blogspot.There are lots of sources of information • The sdk comes with the API which has lots of useful examples. details • There is http://www. 2010 .

Sign up to vote on this title
UsefulNot useful