Android Chapter01 Intro PDF
Android Chapter01 Intro PDF
Android Development
Introduction
Victor Matos
Cleveland State University
Portions of this page are reproduced from work created and shared by Google and used according to terms
described in the Creative Commons 3.0 Attribution License.
Mobile Phone Evolution
• iPhone
2007 • Android
1-2
Images from: http://en.wikipedia.org/wiki/Dick_Tracy http://en.wikipedia.org/wiki/Martin_Cooper_(inventor)
Hardware: What is inside a Smart Cellular Phone?
Oversimplifying…
= +
1-3
Hardware: Reusing Cell Phone Frequencies
• Third party Java developers can use the Android API to extend the
functionality of the devices.
1-5
Why Android?
“…currently it is too difficult to make new products … open software brings more
innovation … choices … lower costs … enables the industry to create….more
applications such as family planner, my taxes, … understand my wife better, … ”
1-6
What is the Open Handset Alliance?
“ … Today, there are 1.5 billion television sets in use around the
world. 1 billion people are on the Internet. But nearly 3 billion people
have a mobile phone, making it one of the world’s most successful
consumer products…
1-7
Open Handset Alliance Members
1. Phone 1. Smartphone
2. Pager 2. Laptop (perhaps!)
3. PDA Organizer
4. Laptop
5. MP3 Portable music player
6. Wired modem
7. No Internet access / limited
access
Tomorrow ?
1 - 10
The Mobile Revolution
Dreaming aloud
I want my 2015 Smartphone to be …
1. Phone
2. Pager
3. PDA Organizer
4. High Quality Camera (still & video)
5. Portable music player
6. Portable TV / Video Player / Radio
7. Laptop
8. Play Station
9. GPS / Compass / Navigation (road & inside buildings)
10. Golf Caddy (ball retriever too)
11. Book Reader (I don’t read, It reads to me with passion!)
12. Electronic key (Car / Home / Office)
13. Remote Control (Garage, TV, …)
14. Credit Card / Driver’s License / Passport / Airplane Ticket
15. Cash
16. Cook, house chores
17. Psychologist / Mentor / Adviser
18. Personal trainer
19. Dance instructor
20. ???? 1 - 11
Android vs. OS Competitors
1.Apple Inc.
2.Microsoft
3.Nokia Symbiam
vs. 4.Palm & webOS
5.Research In Motion
1 - 12
Android Software/Hardware Components
1 - 13
Android’s Software Architecture
1 - 14
Android’s Software Architecture
Video 1/3:
Software Layers
Presented by Mike Cleron, Google Corp. (13 min)
Available at: http://www.youtube.com/watch?v=QBGfUs9mQYY
1 - 15
Android’s Software Architecture
Video 2/3:
Application’s Life Cycle
Presented by Mike Cleron, Google Corp. (7 min)
Available at: http://www.youtube.com/watch?v=fL6gSd4ugSI&feature=channel
1 - 16
Android’s Software Architecture
Video 3/3:
Android’s API
Presented by Mike Cleron, Google Corp. (8 min)
Video available at:
http://www.youtube.com/watch?v=MPukbH6D-lY&feature=channel
1 - 17
Android Application Framework
Video:
Inside the
Android Application Framework
(about 52 min)
Presented by Dan Morrill – Google
At Google Developer Conference
San Francisco – 2008
Available at:
http://sites.google.com/site/io/inside-the-android-application-framework
Android is designed to be fast, powerful, and easy to develop for. This session will
discuss the Android application framework in depth, showing you the machinery
behind the application framework.
Video:
Android Development Tools
(about 60 min)
Presented by
• Xavier Ducrohet, tech-lead for the Android SDK and Developer Tools.
• Tor Norbye, engineer on the Android SDK team working on visual tools for
Android development.
LINK:
http://www.google.com/events/io/2011/sessions/android-development-tools.html
1 - 19
An Introduction to Android
Video:
An Introduction to Android
(about 52 min)
1 - 20
The Dalvik Virtual Machine
1 - 21
Android Intents
Action Data
1 - 22
Android Intents
Some examples of Intent’s action/data pairs are:
ACTION_VIEW tel:123 -- Display the phone dialer with the given number
filled in
ACTION_DIAL tel:123 -- Display the phone dialer with the given number filled
in.
The following code fragment calls an Intent whose job is to invoke a built-in
task (ACTION_VIEW) and explore the Contacts available in the phone.
startActivity(myIntent);
1 - 24
Example1: Java + Built-in Intent Intent uses ACTION_VIEW
to see Contacts.
1 - 25
Example1: Java + Built-in Intent
startActivity(myIntent);
}
1 - 26
Dissecting an Android Application
Structure of a
typical Android
Application
(Shown by Eclipse’s
Project Explorer)
1 - 27
Dissecting an Android Application
Structure of a
typical Android
Application
(Android Studio)
1 - 28
Android Manifest XML File
1 - 29
Android Manifest XML File
<action> <permission>
<activity> <permission-group>
<activity-alias> <permission-tree>
<application> <provider>
<category> <receiver>
<data> <service>
<grant-uri-permission> <uses-configuration>
<instrumentation> <uses-library>
<intent-filter> <uses-permission>
<manifest> <uses-sdk>
<meta-data>
1 - 30
Android Manifest XML File
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="matos.earthquake"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/yellow_circle" android:label="@string/app_name">
<activity android:name=".AndQuake"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</manifest> 1 - 31
Example2. Currency converter
Note.
Naive implementation using a fixed
exchange rate:
1 Costa Rican Colon = 0.0019 U.S. dollars
1 Euro = 1.35 U.S. dollars
1 - 32
Example2. Currency converter
package csu.matos.currencyconverter;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
1 - 34
Example2. Currency converter
// do the conversion from USD to Euros and Colones
btnConvert = (Button) findViewById(R.id.btnConvert);
btnConvert.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
String usdStr = txtUSDollars.getText().toString();
double usd = Double.parseDouble(usdStr);
String euros = EUROSYM +
String.valueOf(usaDf.format(usd / EURO2USD));
String colones = COLONSYM +
String.valueOf(usaDf.format(usd / COLON2USD));
txtEuros.setText(euros);
txtColones.setText(colones);
} catch (NumberFormatException e) {
// ignore errors
}
}
});// setOnClick...
}// onCreate
}// class
1 - 35
Example2. Currency converter
11-36
- 36
Example2. Currency converter
LAYOUT: res/layout/activity_main_linear.xml (1 of 3)
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="5"
android:gravity="right"
android:text="US Dollars" />
<EditText
android:id="@+id/txtUSDollars"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:hint="Enter US Dollars amount"
android:inputType="numberDecimal" />
<requestFocus />
</LinearLayout>
1 - 37
Example2. Currency converter
LAYOUT: res/layout/activity_main_linear.xml (2 of 3)
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="5"
android:gravity="right"
android:text="Euros" />
<EditText
android:id="@+id/txtEuros"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="5"
android:gravity="right"
android:text="Colon CR" />
1 - 38
Example2. Currency converter
LAYOUT: res/layout/activity_main_linear.xml (3 of 3)
<EditText
android:id="@+id/txtColones"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:editable="false" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/btnClear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Clear" />
<Button
android:id="@+id/btnConvert"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="Convert" />
</LinearLayout>
</LinearLayout>
1 - 39
APPENDIX A.
Reference:
http://gizmodo.com/5489
036/cellphone-overshare
40
The Size of the Mobile Market – 2009
Extracted from: http://gizmodo.com/5489036/cellphone-overshare Accessed on April 2010
2009 480 m
Mobile market Papers
compared to other
1.4bn
technologies Internet users
worldwide 4 bn
Mobile Phone
worldwide
(half the
population of the
planet)
5.33% 1.5bn
6.69%
Movie information Business Directory Televisions
7.13% worlwide
Traded Stocks and
Financial
11.94%
Entertainment
News 48.7%
News and Sport
Information
20.21%
Social
Networking Content
accessed from
mobile phones
1 - 41
The Size of the Mobile Market – 2009 Extracted from:
http://gizmodo.com/5489036/cellphone-overshare
http://www.microsoft.com/investor/reports/ar09/10k_fr_bal.html
Exxon Mobil 2009 Summary Annual Report
2010 Toyota Annual Report (pp 12)
Microsoft
$78bn
$130 bn
Toyota Motors Messaging
$204bn
$600 bn
Voice $70 bn
Non-messaging
Exxon Mobil
$301bn
Revenue is the
collective amount of
income made by a
company (usually from
the sales of goods &
services)
1 - 42
The Size of the Mobile Market – 2009
Extracted from: http://gizmodo.com/5489036/cellphone-overshare Accessed on April 2010
1.94% Yahoo
97.57% 2.43%
Google
0.63% Other
0.25% Ask
0.11% MSM
1 - 43
The Size of the Mobile Market – 2009
Extracted from: http://gizmodo.com/5489036/cellphone-overshare Accessed on April 2010
2009
1 - 44
The Size of the Mobile Market – Fourth Quarter 2009-Q4
Extracted from: http://gizmodo.com/5489036/cellphone-overshare Accessed on April 2010
2009
Mobile Operating System
Market Share Worldwide
19% 13%
RIM iPhone
9%
Windows
6% Other
2%
Android
51%
Symbian
1 - 45
The Size of the Mobile Market – Second Quarter 2010-Q2
Extracted from: http://gizmodo.com/5489036/cellphone-overshare Accessed on April 2010
Others
Microsoft 5%
5%
Google
17%
RIM
18%
Apple
14% Nokia
41%
1 - 46
The Size of the Mobile Market – Fourth Quarter 2010-Q4
Extracted from: http://gizmodo.com/5489036/cellphone-overshare Accessed on April 2010
RIM
14.6% Google
32.9%
Nokia
30.6%
1 - 47
The Size of the Mobile Market – Second Quarter 2011-Q2
Extracted from: http://gizmodo.com/5489036/cellphone-overshare Accessed on April 2010
Windows,
Others, 3%
WebOs, 5%
RIM, 11%
Android, 52%
iPhone , 29%
1 - 48
The Size of the Mobile Market – First Quarter 2014-Q1
Taken on Sept 2014, from:
http://techcrunch.com/2014/05/06/android-still-growing-market-share-by-winning-first-time-smartphone-users/
1 - 50
Some New Products-Ideas for 2011 -15
Open Automotive Alliance
http://www.openautoalliance.net/#members
Wearable devices
1 - 51
Some New Products-Ideas for 2011 -15
Founding members
Audi, GM, Google, Honda, Hyundai and NVIDIA
New Members
• Alpine • FUJITSU TEN • Nissan • Subaru
• Bentley • HARMAN • Panasonic • Suzuki
• Clarion • Infiniti • Parrot • Symphony
• CloudCar • JVCKENWOOD • Pioneer Teleca
• Delphi • LG • Renault • Volkswagen
• FIAT Chrysler • Maserati • Renesas • Volvo
• Ford • Mazda • SEAT
• Freescale • Mitsubishi • Škoda
1 - 52
Cell-Phone Diffusion
Mount Kilimanjaro
Tanzania, October 2010
1 - 53
Cell-Phone Diffusion
Taken from
Determinants of Mobile Phone
Penetration Rates in Asia and Africa: A
Panel Data Analysis. By Kokila P. Doshi
and Andrew Narwold.
Proceedings of 9th International
Business and Social Science Research
Conference January, 2014, Dubai, UAE,
ISBN: 978-1-922069-41-2
Figure 1.
Mobile subscription per 100
inhabitants
Figure 2.
Fixed lines per 100 inhabitants
1 - 54
Thanks for being here
Questions?
1 - 55