0
The Android GUI Framework Android experience day December 2008 Markus Pilz Peter Wlodarczak
Agenda 1. Introduction 2. Anatomy   3. A real word example   4. Life cycle   5. Trends   6. Findings
Why Android <ul><li>Android was designed as a platform for software development </li></ul><ul><li>Android is open </li></u...
Android Platform
Anatomy I <ul><li>Android is Linux based </li></ul><ul><li>GUI is fully written in Java </li></ul><ul><li>Java 1.5 support...
Anatomy II <ul><li>Activity </li></ul><ul><li>View </li></ul><ul><li>Service </li></ul><ul><li>Content provider </li></ul>...
Anatomy III <ul><li>Storage </li></ul><ul><li>Security </li></ul><ul><li>Life cycle management </li></ul><ul><li>Native ca...
A real word example I <ul><li>A translator for Android </li></ul><ul><li>You cannot read anything </li></ul><ul><li>If you...
A real word example II <ul><li>Uses the Google translator </li></ul><ul><li>Can be extended with new languages </li></ul><...
A real word example III Lets see it
A real word example IV <ul><li>Used Eclipse for development </li></ul><ul><li>Uses persistence of user data </li></ul><ul>...
A real word example V <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.gre...
A real word example V <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.gre...
A real word example V <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.gre...
A real word example VI The AndroidManifest.xml <ul><li>Used for security </li></ul><ul><li>Give other Activities access </...
A real word example VII <ul><li><ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul...
A real word example VII <ul><li><ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul...
A real word example VIII <ul><li>Could also be developed purely in Java </li></ul><ul><li>Not all the attributes can be de...
A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mC...
A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mC...
A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mC...
A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mC...
A real word example X @Override public boolean onOptionsItemSelected(Menu.Item item) { switch (item.getId()) { case 0: sho...
A real word example X @Override public boolean onOptionsItemSelected(Menu.Item item) { switch (item.getId()) { case 0: sho...
A real word example X @Override public boolean onOptionsItemSelected(Menu.Item item) { switch (item.getId()) { case 0: sho...
A real word example XI <ul><li>@Override </li></ul><ul><li>protected void onPause() { </li></ul><ul><li>super.onPause(); <...
A real word example XII Store user data <ul><li>Preferences </li></ul><ul><li>Files </li></ul><ul><li>Content provider </l...
Life cycle <ul><li>Life cycle not directly controlled by application </li></ul><ul><li>Controll through onCreate(), onPaus...
Trends I <ul><li>Eyes-free user interfaces </li></ul><ul><li>Other user interfaces like tones, vibrant alarm, sensors, act...
Trends II <ul><li>Speech recognition </li></ul><ul><li>Accelerometer </li></ul><ul><li>Magnetic compass </li></ul><ul><li>...
Findings <ul><li>Android uses proven technology like Java, XML and Linux </li></ul><ul><li>There is an initial learning ef...
Some figures <ul><li>Q4 2007 more than 3 billion mobile subscribers (world population 6.7 billion)‏ </li></ul><ul><li>1.14...
Thank you for the attention Questions? Find out more at: http://code.google.com/android
Upcoming SlideShare
Loading in...5
×

Android

4,911

Published on

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

No Downloads
Views
Total Views
4,911
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
372
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Android"

  1. 1. The Android GUI Framework Android experience day December 2008 Markus Pilz Peter Wlodarczak
  2. 2. Agenda 1. Introduction 2. Anatomy 3. A real word example 4. Life cycle 5. Trends 6. Findings
  3. 3. Why Android <ul><li>Android was designed as a platform for software development </li></ul><ul><li>Android is open </li></ul><ul><li>Android is free </li></ul><ul><li>Community support </li></ul><ul><li>Tool support </li></ul>
  4. 4. Android Platform
  5. 5. Anatomy I <ul><li>Android is Linux based </li></ul><ul><li>GUI is fully written in Java </li></ul><ul><li>Java 1.5 support </li></ul><ul><li>Widget toolkit </li></ul><ul><li>XML based GUI </li></ul><ul><li>Single Touch screen </li></ul>
  6. 6. Anatomy II <ul><li>Activity </li></ul><ul><li>View </li></ul><ul><li>Service </li></ul><ul><li>Content provider </li></ul><ul><li>Intent, IntentFilter, IntertReceiver </li></ul>
  7. 7. Anatomy III <ul><li>Storage </li></ul><ul><li>Security </li></ul><ul><li>Life cycle management </li></ul><ul><li>Native calls (not officially)‏ </li></ul><ul><li>AIDL </li></ul><ul><li>NLS support </li></ul>
  8. 8. A real word example I <ul><li>A translator for Android </li></ul><ul><li>You cannot read anything </li></ul><ul><li>If you are in a country where no one understands your language </li></ul><ul><li>No additional device needed </li></ul><ul><li>You have your mobile phone always with you </li></ul>
  9. 9. A real word example II <ul><li>Uses the Google translator </li></ul><ul><li>Can be extended with new languages </li></ul><ul><li>Adaptive GUI </li></ul><ul><li>Uses XMPP for data transmission </li></ul><ul><li>GUI fully defined in XML </li></ul>
  10. 10. A real word example III Lets see it
  11. 11. A real word example IV <ul><li>Used Eclipse for development </li></ul><ul><li>Uses persistence of user data </li></ul><ul><li>Uses touch screen and keyboard input </li></ul><ul><li>ANT script and make for build </li></ul>
  12. 12. A real word example V <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.greenliff.translator&quot;> <application android:icon=&quot;@drawable/logo&quot;> <activity android:label=&quot;@string/settings&quot; android:name=&quot;Settings&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> </intent-filter> </activity> <activity android:label=&quot;@string/app_name&quot; android:name=&quot;Translate&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> <category android:name=&quot;android.intent.category.LAUNCHER&quot; /> </intent-filter> </activity> <activity android:label=&quot;@string/ocr&quot; android:name=&quot;OCR&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> </intent-filter> </activity> </application> </manifest> The AndroidManifest.xml
  13. 13. A real word example V <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.greenliff.translator&quot;> <application android:icon=&quot;@drawable/logo&quot;> < activity android:label=&quot;@string/settings&quot; android:name=&quot;Settings&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> </intent-filter> </activity> < activity android:label=&quot;@string/app_name&quot; android:name=&quot;Translate&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> <category android:name=&quot;android.intent.category.LAUNCHER&quot; /> </intent-filter> </activity> < activity android:label=&quot;@string/ocr&quot; android:name=&quot;OCR&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> </intent-filter> </activity> </application> </manifest> The AndroidManifest.xml Activity
  14. 14. A real word example V <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.greenliff.translator&quot;> <application android:icon=&quot;@drawable/logo&quot;> < activity android:label=&quot;@string/settings&quot; android:name=&quot;Settings&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> </intent-filter> </activity> < activity android:label=&quot;@string/app_name&quot; android:name=&quot;Translate&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> <category android:name=&quot; android.intent.category.LAUNCHER &quot; /> </intent-filter> </activity> < activity android:label=&quot;@string/ocr&quot; android:name=&quot;OCR&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> </intent-filter> </activity> </application> </manifest> The AndroidManifest.xml Activity Launch
  15. 15. A real word example VI The AndroidManifest.xml <ul><li>Used for security </li></ul><ul><li>Give other Activities access </li></ul><ul><li>Define permissions, e. g. </li></ul><ul><ul><li> <uses-permission android:name=&quot;android.permission.RECEIVE_SMS&quot; /> </li></ul></ul>
  16. 16. A real word example VII <ul><li><ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul><ul><li>android:layout_width=&quot;fill_parent&quot; </li></ul><ul><li>android:layout_height=&quot;wrap_content&quot; </li></ul><ul><li>android:scrollbars=&quot;vertical&quot;> </li></ul><ul><li><LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul><ul><ul><li>android:id=&quot;@+id/linLayout&quot; </li></ul></ul><ul><ul><li>android:orientation=&quot;vertical&quot; </li></ul></ul><ul><ul><li>android:layout_width=&quot;fill_parent&quot; </li></ul></ul><ul><ul><li>android:layout_height=&quot;wrap_content&quot;> </li></ul></ul><ul><li><TextView </li></ul><ul><li> android:layout_width=&quot;fill_parent&quot; </li></ul><ul><li> android:layout_height=&quot;wrap_content&quot; </li></ul><ul><li> android:background=&quot;@drawable/blue&quot; </li></ul><ul><li> android:text=&quot; @string/translate_to_1 &quot;/> </li></ul><ul><li><EditText </li></ul><ul><li> android:id=&quot;@+id/toTranslate&quot; </li></ul><ul><li> android:layout_width=&quot;fill_parent&quot; </li></ul><ul><ul><ul><li>android:layout_height=&quot;wrap_content&quot; </li></ul></ul></ul><ul><ul><ul><li>android:background=&quot;@android:drawable/editbox_background&quot; </li></ul></ul></ul><ul><ul><ul><li>android:layout_below=&quot;@id/linLayout“ </li></ul></ul></ul><ul><ul><ul><li>android:hint=&quot;Type here...&quot; /> </li></ul></ul></ul><ul><li>..... </li></ul>An XML snipped of the main Activity Text reference
  17. 17. A real word example VII <ul><li><ScrollView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul><ul><li>android:layout_width=&quot;fill_parent&quot; </li></ul><ul><li>android:layout_height=&quot;wrap_content&quot; </li></ul><ul><li>android:scrollbars=&quot;vertical&quot;> </li></ul><ul><li><LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul><ul><ul><li>android:id=&quot; @+id/linLayout &quot; </li></ul></ul><ul><ul><li>android:orientation=&quot;vertical&quot; </li></ul></ul><ul><ul><li>android:layout_width=&quot;fill_parent&quot; </li></ul></ul><ul><ul><li>android:layout_height=&quot;wrap_content&quot;> </li></ul></ul><ul><li><TextView </li></ul><ul><li> android:layout_width=&quot;fill_parent&quot; </li></ul><ul><li> android:layout_height=&quot;wrap_content&quot; </li></ul><ul><li> android:background=&quot;@drawable/blue&quot; </li></ul><ul><li> android:text=&quot; @string/translate_to_1 &quot;/> </li></ul><ul><li><EditText </li></ul><ul><li> android:id=&quot;@+id/toTranslate&quot; </li></ul><ul><li> android:layout_width=&quot;fill_parent&quot; </li></ul><ul><ul><ul><li>android:layout_height=&quot;wrap_content&quot; </li></ul></ul></ul><ul><ul><ul><li>android:background=&quot;@android:drawable/editbox_background&quot; </li></ul></ul></ul><ul><ul><ul><li>android:layout_below=&quot;@id/linLayout“ </li></ul></ul></ul><ul><ul><ul><li>android:hint=&quot;Type here...&quot; /> </li></ul></ul></ul><ul><li>..... </li></ul>An XML snipped of the main Activity Text reference Id
  18. 18. A real word example VIII <ul><li>Could also be developed purely in Java </li></ul><ul><li>Not all the attributes can be defined in XML </li></ul><ul><li>XML cannot be debugged </li></ul>
  19. 19. A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mContext = wp.getContext(); setTheme(android.R.style.Theme_Light); setContentView(R.layout.main); mLayout = (LinearLayout) this.findViewById(R.id.linLayout); mToTranslate = (EditText) this.findViewById(R.id.toTranslate); setShowLanguages(); mEnge = (LinearLayout) this.findViewById(R.id.enge); LANGUAGE_LAYOUT[0] = mEnge; de2en = (Button) this.findViewById(R.id.de2en); de2en.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if(!connect()) { notLoggedInAlert(); } else { doConnect(&quot;de2en@bot.talk.google.com&quot;); rearrange(mEnge); } } }); .... A code snipped of the Translate Activity
  20. 20. A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mContext = wp.getContext(); setTheme(android.R.style.Theme_Light); setContentView( R.layout.main ); mLayout = (LinearLayout) this.findViewById( R.id.linLayout ); mToTranslate = (EditText) this.findViewById(R.id.toTranslate); setShowLanguages(); mEnge = (LinearLayout) this.findViewById(R.id.enge); LANGUAGE_LAYOUT[0] = mEnge; de2en = (Button) this.findViewById(R.id.de2en); de2en.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if(!connect()) { notLoggedInAlert(); } else { doConnect(&quot;de2en@bot.talk.google.com&quot;); rearrange(mEnge); } } }); .... A code snipped of the Translate Activity Set layout
  21. 21. A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mContext = wp.getContext(); setTheme(android.R.style.Theme_Light); setContentView( R.layout.main ); mLayout = (LinearLayout) this.findViewById( R.id.linLayout ); mToTranslate = (EditText) this.findViewById( R.id.toTranslate ); setShowLanguages(); mEnge = (LinearLayout) this.findViewById( R.id.enge ); LANGUAGE_LAYOUT[0] = mEnge; de2en = (Button) this.findViewById( R.id.de2en ); de2en.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if(!connect()) { notLoggedInAlert(); } else { doConnect(&quot;de2en@bot.talk.google.com&quot;); rearrange(mEnge); } } }); .... A code snipped of the Translate Activity Set layout Find elements
  22. 22. A real word example IX @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window wp = getWindow(); mContext = wp.getContext(); setTheme(android.R.style.Theme_Light); setContentView( R.layout.main ); mLayout = (LinearLayout) this.findViewById( R.id.linLayout ); mToTranslate = (EditText) this.findViewById( R.id.toTranslate ); setShowLanguages(); mEnge = (LinearLayout) this.findViewById( R.id.enge ); LANGUAGE_LAYOUT[0] = mEnge; de2en = (Button) this.findViewById( R.id.de2en ); de2en.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if(!connect()) { notLoggedInAlert(); } else { doConnect(&quot;de2en@bot.talk.google.com&quot;); rearrange(mEnge); } } }); .... A code snipped of the Translate Activity Set layout Find elements Add behavior
  23. 23. A real word example X @Override public boolean onOptionsItemSelected(Menu.Item item) { switch (item.getId()) { case 0: showLogin(); break; case 1: Intent intent = new Intent(Translate.this, Settings.class); intent.putExtras(mShownLanguages); startSubActivity(intent, SETTINGS); break; } // switch return true; } Call an other Activity
  24. 24. A real word example X @Override public boolean onOptionsItemSelected(Menu.Item item) { switch (item.getId()) { case 0: showLogin(); break; case 1: Intent intent = new Intent(Translate.this, Settings.class); intent.putExtras(mShownLanguages); startSubActivity(intent, SETTINGS); break; } // switch return true; } Call an other Activity Start an Activity
  25. 25. A real word example X @Override public boolean onOptionsItemSelected(Menu.Item item) { switch (item.getId()) { case 0: showLogin(); break; case 1: Intent intent = new Intent(Translate.this, Settings.class); intent.putExtras(mShownLanguages); startSubActivity(intent, SETTINGS); break; } // switch return true; } Call an other Activity Start an Activity Pass data to new Activity
  26. 26. A real word example XI <ul><li>@Override </li></ul><ul><li>protected void onPause() { </li></ul><ul><li>super.onPause(); </li></ul><ul><li>SharedPreferences.Editor ed = mPrefs.edit(); </li></ul><ul><li>for(int i = 0; i < SUPPORTED_LANGUAGES.length; i++) { </li></ul><ul><ul><li>ed.putBoolean(SUPPORTED_LANGUAGES[i], mShownLanguages.getBoolean(SUPPORTED_LANGUAGES[i])); </li></ul></ul><ul><li>} </li></ul><ul><li>ed.commit(); </li></ul><ul><li>} </li></ul>Store user data Persistent store
  27. 27. A real word example XII Store user data <ul><li>Preferences </li></ul><ul><li>Files </li></ul><ul><li>Content provider </li></ul><ul><li>Database </li></ul><ul><li>Network </li></ul>
  28. 28. Life cycle <ul><li>Life cycle not directly controlled by application </li></ul><ul><li>Controll through onCreate(), onPause(), onStop() ... methods </li></ul><ul><li>Android has different types of processes, visible processes, service processes, background processes ... </li></ul><ul><li>System can kill an application to free up memory </li></ul><ul><li>Services can be used for long-lived background processes </li></ul>
  29. 29. Trends I <ul><li>Eyes-free user interfaces </li></ul><ul><li>Other user interfaces like tones, vibrant alarm, sensors, actuators </li></ul><ul><li>Leverage hearing and touch </li></ul><ul><li>Camera input </li></ul><ul><li>Ubiquitous computing technologies </li></ul>
  30. 30. Trends II <ul><li>Speech recognition </li></ul><ul><li>Accelerometer </li></ul><ul><li>Magnetic compass </li></ul><ul><li>Location self-awareness </li></ul><ul><li>Locating others </li></ul><ul><li>Sensing the environment </li></ul>
  31. 31. Findings <ul><li>Android uses proven technology like Java, XML and Linux </li></ul><ul><li>There is an initial learning effort </li></ul><ul><li>Android doesn‘t have many of the limitations other mobile platforms have </li></ul><ul><li>It offers a rich API for application development </li></ul><ul><li>Trend towards eyes-free user interfaces </li></ul>
  32. 32. Some figures <ul><li>Q4 2007 more than 3 billion mobile subscribers (world population 6.7 billion)‏ </li></ul><ul><li>1.14 billion handsets delivered in 2007 (computers 271.2 million)‏ </li></ul><ul><li>118 million where smart phones </li></ul><ul><li>Currently more than 30 mobile platforms </li></ul><ul><li>Symbian leads with 65% share, ahead of Microsoft on 12%, RIM on 11%, Apple on 7%, and Linux at 5% </li></ul>
  33. 33. Thank you for the attention Questions? Find out more at: http://code.google.com/android
  1. A particular slide catching your eye?

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

×