Google Android Mobile Computing Bruce Scharlau, University of Aberdeen, 2009 Based on  android-sdk_1.6-r1
Android is part of the ‘build a better phone’ process <ul><li>Open Handset Alliance produces Android </li></ul>Bruce Schar...
Android is growing Bruce Scharlau, University of Aberdeen, 2009 http://www.admob.com/marketing/pdf/mobile_metrics_jan_09.p...
Android makes mobile Java easier Bruce Scharlau, University of Aberdeen, 2009 http://code.google.com/android/goodies/index...
Android applications are written in Java <ul><li>package com.google.android.helloactivity; </li></ul><ul><li>import androi...
Android applications are compiled to Dalvik bytecode Bruce Scharlau, University of Aberdeen, 2009 Write app in Java Compil...
The Dalvik runtime is optimised for mobile applications <ul><li>Run multiple VMs efficiently </li></ul>Bruce Scharlau, Uni...
Android has many components  Bruce Scharlau, University of Aberdeen, 2009 Bluetooth and USB drivers now gone from kernel X...
Android has a working emulator Bruce Scharlau, University of Aberdeen, 2009
All applications are written in Java and available to each other <ul><li>Android designed to enable reuse of components in...
Android applications have common structure Bruce Scharlau, University of Aberdeen, 2009 Views  such as lists, grids, text ...
Android applications have common structure Bruce Scharlau, University of Aberdeen, 2009 Broadcast receivers  can trigger i...
There is a common file structure for applications Bruce Scharlau, University of Aberdeen, 2009 code images files UI layout...
Standard components form building blocks for Android apps Bruce Scharlau, University of Aberdeen, 2009 Other applications ...
The AndroidManifest lists application details <ul><li><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> </li></ul...
Activity is one thing you can do Bruce Scharlau, University of Aberdeen, 2009 From fundamentals page in sdk
Intent provides late running binding to other apps <ul><li>It can be thought of as the glue between activities. It is basi...
Services declared in the manifest and provide support Bruce Scharlau, University of Aberdeen, 2009 Services run in the bac...
Notifications let you know of background events Bruce Scharlau, University of Aberdeen, 2009 This way you know that an SMS...
ContentProviders share data Bruce Scharlau, University of Aberdeen, 2009 You need one if your application shares data with...
UI layouts are in Java and XML Bruce Scharlau, University of Aberdeen, 2009 setContentView(R.layout.hello_activity); //wil...
Security in Android follows standard Linux guidelines Bruce Scharlau, University of Aberdeen, 2009 Each application runs i...
There are lots of sources of information <ul><li>The sdk comes with the API references, sample applications and docs/resou...
Upcoming SlideShare
Loading in...5
×

Google Android

578

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
578
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Google Android

  1. 1. Google Android Mobile Computing Bruce Scharlau, University of Aberdeen, 2009 Based on android-sdk_1.6-r1
  2. 2. Android is part of the ‘build a better phone’ process <ul><li>Open Handset Alliance produces Android </li></ul>Bruce Scharlau, University of Aberdeen, 2009 Comprises handset manufacturers, software firms, mobile operators, and other manufactures and funding companies http://www.openhandsetalliance.com/
  3. 3. Android is growing Bruce Scharlau, University of Aberdeen, 2009 http://www.admob.com/marketing/pdf/mobile_metrics_jan_09.pdf Small, 1% of online web requests http://metrics.admob.com/ - Sept 2009 Bigger, 10% of online web requests
  4. 4. Android makes mobile Java easier Bruce Scharlau, University of Aberdeen, 2009 http://code.google.com/android/goodies/index.html Well, sort of…
  5. 5. Android applications are written in Java <ul><li>package com.google.android.helloactivity; </li></ul><ul><li>import android.app.Activity; </li></ul><ul><li>import android.os.Bundle; </li></ul><ul><li>public class HelloActivity extends Activity { </li></ul><ul><li>public HelloActivity() { </li></ul><ul><li>} </li></ul><ul><li>@Override </li></ul><ul><li>public void onCreate(Bundle icicle) { </li></ul><ul><li>super.onCreate(icicle); </li></ul><ul><li>setContentView(R.layout.hello_activity); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  6. 6. Android applications are compiled to Dalvik bytecode Bruce Scharlau, University of Aberdeen, 2009 Write app in Java Compiled in Java Transformed to Dalvik bytecode Linux OS Loaded into Dalvik VM
  7. 7. The Dalvik runtime is optimised for mobile applications <ul><li>Run multiple VMs efficiently </li></ul>Bruce Scharlau, University of Aberdeen, 2009 Each app has its own VM Minimal memory footprint
  8. 8. Android has many components Bruce Scharlau, University of Aberdeen, 2009 Bluetooth and USB drivers now gone from kernel XMPP gone from application framework
  9. 9. Android has a working emulator Bruce Scharlau, University of Aberdeen, 2009
  10. 10. All applications are written in Java and available to each other <ul><li>Android designed to enable reuse of components in other applications </li></ul>Bruce Scharlau, University of Aberdeen, 2009 Each application can publish its capabilities which other apps can use
  11. 11. Android applications have common structure Bruce Scharlau, University of Aberdeen, 2009 Views such as 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 A Notification Manager that enables all apps to display custom alerts in the status bar An Activity Manager that manages the life cycle of applications and provides a common navigation backstack
  12. 12. Android applications have common structure Bruce Scharlau, University of Aberdeen, 2009 Broadcast receivers can trigger intents that start an application Data storage provide data for your apps, and can be shared between apps – database, file, and shared preferences (hash map) used by group of applications Services run in the background and have no UI for the user – they will update data, and trigger events Intents specify what specific action should be performed Activity is the presentation layer of your app: there will be one per screen, and the Views provide the UI to the activity
  13. 13. There is a common file structure for applications Bruce Scharlau, University of Aberdeen, 2009 code images files UI layouts constants Autogenerated resource list
  14. 14. Standard components form building blocks for Android apps Bruce Scharlau, University of Aberdeen, 2009 Other applications Has life-cycle screen App to handle content Background app Like music player Views manifest Activity Intents Service Notifications ContentProviders
  15. 15. The AndroidManifest lists application details <ul><li><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> </li></ul><ul><li><manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul><ul><li>package=&quot;com.my_domain.app.helloactivity&quot;> </li></ul><ul><li><application android:label=&quot;@string/app_name&quot;> </li></ul><ul><li><activity android:name=&quot;.HelloActivity&quot;> </li></ul><ul><li><intent-filter> </li></ul><ul><li><action android:name=&quot;android.intent.action.MAIN&quot;/> </li></ul><ul><li><category android:name=&quot;android.intent.category.LAUNCHER&quot;/> </li></ul><ul><li></intent-filter> </li></ul><ul><li></activity> </li></ul><ul><li></application> </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  16. 16. Activity is one thing you can do Bruce Scharlau, University of Aberdeen, 2009 From fundamentals page in sdk
  17. 17. Intent provides late running binding to other apps <ul><li>It can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed. </li></ul>Bruce Scharlau, University of Aberdeen, 2009 Written as action/data pairs such as: VIEW_ACTION/ACTION content://contacts/1
  18. 18. Services declared in the manifest and provide support Bruce Scharlau, University of Aberdeen, 2009 Services run in the background: Music player providing the music playing in an audio application Intensive background apps, might need to spawn their own thread so as to not block the application
  19. 19. Notifications let you know of background events Bruce Scharlau, University of Aberdeen, 2009 This way you know that an SMS arrived, or that your phone is ringing, and the MP3 player should pause
  20. 20. ContentProviders share data Bruce Scharlau, University of Aberdeen, 2009 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
  21. 21. UI layouts are in Java and XML Bruce Scharlau, University of Aberdeen, 2009 setContentView(R.layout.hello_activity); //will load the XML UI file
  22. 22. Security in Android follows standard Linux guidelines Bruce Scharlau, University of Aberdeen, 2009 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=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.google.android.app.myapp&quot; > <uses-permission id=&quot;android.permission.RECEIVE_SMS&quot; /> </manifest>
  23. 23. There are lots of sources of information <ul><li>The sdk comes with the API references, sample applications and docs/resources/bootcamp.pdf </li></ul><ul><li>There are Google news groups </li></ul><ul><li>There is http://www.anddev.org </li></ul><ul><li>There is Google search </li></ul>Bruce Scharlau, University of Aberdeen, 2009
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×