SlideShare a Scribd company logo
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
 Android was designed as a platform for
software development
 Android is open
 Android is free
 Community support
 Tool support
Android Platform
Anatomy I
 Android is Linux based
 GUI is fully written in Java
 Java 1.5 support
 Widget toolkit
 XML based GUI
 Single Touch screen
Anatomy II
 Activity
 Intent, IntentFilter, IntertReceiver
 View
 Service
 Content provider
Anatomy III
 Storage
 AIDL
 Security
 Life cycle management
 Native calls (not officially)

 NLS support
A real word example I
 A translator for Android
 If you are in a country where no one
understands your language

 You cannot read anything
 You have your mobile
phone always with you
 No additional device needed
A real word example II
 Uses the Google translator
 Uses XMPP for data transmission
 Can be extended with new languages
 Adaptive GUI
 GUI fully defined in XML
A real word example III

Lets see it
A real word example IV
 Used Eclipse for development
 ANT script and make for build
 Uses persistence of user data
 Uses touch screen and keyboard input
A real word example V
The AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.greenliff.translator">
<application android:icon="@drawable/logo">
<activity android:label="@string/settings" android:name="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name="Translate">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="@string/ocr" android:name="OCR">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
A real word example V
The AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.greenliff.translator">
<application android:icon="@drawable/logo">
<activity android:label="@string/settings" android:name="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name="Translate">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="@string/ocr" android:name="OCR">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
A real word example V
The AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.greenliff.translator">
<application android:icon="@drawable/logo">
<activity android:label="@string/settings" android:name="Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:label="@string/app_name" android:name="Translate">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="@string/ocr" android:name="OCR">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>

Launch
A real word example VI
The AndroidManifest.xml

 Used for security
 Define permissions, e. g.
<uses-permission android:name="android.permission.RECEIVE_SMS" />

 Give other Activities access
A real word example VII
An XML snipped of the main Activity
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linLayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="fill_parent"
Text reference
android:layout_height="wrap_content"
android:background="@drawable/blue"
android:text="@string/translate_to_1"/>
<EditText
android:id="@+id/toTranslate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/linLayout“
android:hint="Type here..." />
.....
A real word example VII
An XML snipped of the main Activity
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linLayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="fill_parent"
Text reference
android:layout_height="wrap_content"
android:background="@drawable/blue"
android:text="@string/translate_to_1"/>
<EditText
android:id="@+id/toTranslate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/linLayout“
android:hint="Type here..." />
.....
A real word example VIII
 Could also be developed purely in Java
 XML cannot be debugged
 Not all the attributes can be defined in XML
A real word example IX
A code snipped of the Translate Activity
@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("de2en@bot.talk.google.com");
rearrange(mEnge);
}
}
});
....
A real word example IX
A code snipped of the Translate Activity

Set layout

@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("de2en@bot.talk.google.com");
rearrange(mEnge);
}
}
});
....
A real word example IX
A code snipped of the Translate Activity

Set layout

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Find
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("de2en@bot.talk.google.com");
rearrange(mEnge);
}
}
});
....

elements
A real word example IX
A code snipped of the Translate Activity

Set layout

@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
Find
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("de2en@bot.talk.google.com");
rearrange(mEnge);
}
}
});

Add behavior

....

elements
A real word example X
Call an other Activity

@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;
}
A real word example X
Call an other Activity

Start an Activity

@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;
}
A real word example X
Call an other Activity

Start an Activity

@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
Pass data to
return true;
}

new Activity
A real word example XI
Store user data

@Override
protected void onPause() {
Persistent store
super.onPause();
SharedPreferences.Editor ed = mPrefs.edit();
for(int i = 0; i < SUPPORTED_LANGUAGES.length; i++) {
ed.putBoolean(SUPPORTED_LANGUAGES[i],
mShownLanguages.getBoolean(SUPPORTED_LANGUAGES[i]));
}
ed.commit();
}
A real word example XII
Store user data
 Preferences
 Database
 Files

 Content provider
 Network
Life cycle
 Life cycle not directly controlled by application
 System can kill an application to free up
memory

 Controll through onCreate(), onPause(),
onStop() ... methods
 Android has different types of processes,
visible processes, service processes,
background processes ...

 Services can be used for long-lived
background processes
Trends I
 Eyes-free user interfaces
 Other user interfaces like tones, vibrant alarm,
sensors, actuators
 Leverage hearing and touch
 Camera input


Ubiquitous computing technologies
Trends II
 Speech recognition
 Accelerometer
 Magnetic compass
 Location self-awareness


Locating others



Sensing the environment
Findings
 Android uses proven technology like Java,
XML and Linux
 It offers a rich API for application development
 There is an initial learning effort
 Android doesn‘t have many of the limitations
other mobile platforms have
 Trend towards eyes-free user interfaces
Some figures
 Q4 2007 more than 3 billion mobile subscribers
(world population 6.7 billion)
 1.14 billion handsets delivered in 2007
(computers 271.2 million)

 118 million where smart phones
 Currently more than 30 mobile platforms
 Symbian leads with 65% share, ahead of
Microsoft on 12%, RIM on 11%, Apple on 7%, and
Linux at 5%
Thank you for the attention

Questions?

Find out more at:
http://code.google.com/android

More Related Content

PPT
Android应用开发简介
PPTX
Android Development project
PPTX
Android apps development
ODP
Ppt 2 android_basics
PDF
Android session 2
PDF
Android development - Activities, Views & Intents
DOCX
STYLISH FLOOR
PDF
Android Basic Components
Android应用开发简介
Android Development project
Android apps development
Ppt 2 android_basics
Android session 2
Android development - Activities, Views & Intents
STYLISH FLOOR
Android Basic Components

What's hot (20)

PPTX
Microsoft MVP ComCamp 2014 발표자료 / 윈도우 8.1 앱개발 새로운 API들 / 이길복, 주신영 MVP
PDF
Android UI Fundamentals part 1
PPTX
Android architecture
DOCX
What is Android?
PDF
Android Components
PDF
04 user interfaces
PDF
Android dev o_auth
PPTX
Android
PPTX
Android 3
PDF
The Glass Class - Tutorial 3 - Android and GDK
PPTX
Android application development the basics (2)
PPT
Android Tutorial
PDF
Five android architecture
PDF
Jaoo - Open Social A Standard For The Social Web
PPT
Android In A Nutshell
PPTX
Open social 2.0 sandbox ee and breaking out of the gadget box
PPT
Introduction to Android Fragments
PPT
Android Bootcamp Tanzania: android manifest
PPTX
Android Application Fundamentals.
Microsoft MVP ComCamp 2014 발표자료 / 윈도우 8.1 앱개발 새로운 API들 / 이길복, 주신영 MVP
Android UI Fundamentals part 1
Android architecture
What is Android?
Android Components
04 user interfaces
Android dev o_auth
Android
Android 3
The Glass Class - Tutorial 3 - Android and GDK
Android application development the basics (2)
Android Tutorial
Five android architecture
Jaoo - Open Social A Standard For The Social Web
Android In A Nutshell
Open social 2.0 sandbox ee and breaking out of the gadget box
Introduction to Android Fragments
Android Bootcamp Tanzania: android manifest
Android Application Fundamentals.
Ad

Similar to Android gui framework (20)

PDF
Android TCJUG
PPT
Android activity, service, and broadcast recievers
PDF
Android Intro
PPTX
Android Development Made Easy - With Sample Project
DOCX
Android Tutorial For Beginners Part-1
PPTX
Introduction to Android Programming
PPT
Synapseindia android apps introduction hello world
PPTX
PDF
Introduction to Android Development
PDF
Android Minnebar
PPTX
Android Development for Beginners with Sample Project - Day 1
PPT
Android
PPT
Beginning Native Android Apps
PDF
Native Android Development Practices
PDF
ハンズオン資料 電話を作ろう(v1.6用)
KEY
Android Workshop
PPTX
Android terminologies
PDF
07_UIAndroid.pdf
PPT
Android Bootcamp Tanzania:understanding ui in_android
PPTX
Compose In Practice
Android TCJUG
Android activity, service, and broadcast recievers
Android Intro
Android Development Made Easy - With Sample Project
Android Tutorial For Beginners Part-1
Introduction to Android Programming
Synapseindia android apps introduction hello world
Introduction to Android Development
Android Minnebar
Android Development for Beginners with Sample Project - Day 1
Android
Beginning Native Android Apps
Native Android Development Practices
ハンズオン資料 電話を作ろう(v1.6用)
Android Workshop
Android terminologies
07_UIAndroid.pdf
Android Bootcamp Tanzania:understanding ui in_android
Compose In Practice
Ad

More from Sri Harsha Pamu (20)

PDF
Lec23-CS110 Computational Engineering
PDF
Lec21-CS110 Computational Engineering
PDF
Lec19-CS110 Computational Engineering
PDF
Lec16-CS110 Computational Engineering
PDF
Lec15-CS110 Computational Engineering
PDF
Lec14-CS110 Computational Engineering
PDF
PDF
Lec12-CS110 Computational Engineering
PDF
Lec10-CS110 Computational Engineering
PDF
Lec09-CS110 Computational Engineering
PDF
Lec08-CS110 Computational Engineering
PDF
Lec07-CS110 Computational Engineering
PDF
Lec06-CS110 Computational Engineering
PDF
Lec04-CS110 Computational Engineering
PDF
Lec03-CS110 Computational Engineering
PDF
Lec02-CS110 Computational Engineering
PDF
Lec01-CS110 Computational Engineering
PDF
Lec1- CS110 Computational Engineering
PDF
Lec25-CS110 Computational Engineering
PPT
Android..imp google
Lec23-CS110 Computational Engineering
Lec21-CS110 Computational Engineering
Lec19-CS110 Computational Engineering
Lec16-CS110 Computational Engineering
Lec15-CS110 Computational Engineering
Lec14-CS110 Computational Engineering
Lec12-CS110 Computational Engineering
Lec10-CS110 Computational Engineering
Lec09-CS110 Computational Engineering
Lec08-CS110 Computational Engineering
Lec07-CS110 Computational Engineering
Lec06-CS110 Computational Engineering
Lec04-CS110 Computational Engineering
Lec03-CS110 Computational Engineering
Lec02-CS110 Computational Engineering
Lec01-CS110 Computational Engineering
Lec1- CS110 Computational Engineering
Lec25-CS110 Computational Engineering
Android..imp google

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Lesson notes of climatology university.
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
01-Introduction-to-Information-Management.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Presentation on HIE in infants and its manifestations
PDF
Classroom Observation Tools for Teachers
PDF
Complications of Minimal Access Surgery at WLH
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Institutional Correction lecture only . . .
Final Presentation General Medicine 03-08-2024.pptx
Supply Chain Operations Speaking Notes -ICLT Program
Lesson notes of climatology university.
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
human mycosis Human fungal infections are called human mycosis..pptx
Cell Types and Its function , kingdom of life
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharma ospi slides which help in ospi learning
Microbial diseases, their pathogenesis and prophylaxis
01-Introduction-to-Information-Management.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Anesthesia in Laparoscopic Surgery in India
VCE English Exam - Section C Student Revision Booklet
Presentation on HIE in infants and its manifestations
Classroom Observation Tools for Teachers
Complications of Minimal Access Surgery at WLH
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Institutional Correction lecture only . . .

Android gui framework

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