Android Programming Workshop22313
Android Programming Workshop22313
Ahmad Hanis
What Is Android
Android
The fact that we can! Only a few years ago you had to
be in the Motorola inner circle to do it!
Mobile platform is the platform of the future
Why Android?
70% of worldwide
market share
1http://testkitchen.colorado.edu/projects/reports/smartphone/smartphone-appendix1/
http://www.gartner.com/it/page.jsp?id=1543014
Android
Operating
System
6
Android Devices
Phone
Tablet
E-Readers
Others
Android-Powered Microwave
Brief History
1996
Brief History
Many
Other
platforms emerged
2005
2007
2008
11
2009
2010
This
13
Distribution of Devices
14
An operating system
Middleware
Key Applications
Security
Memory management
Process management
Power management
Hardware drivers
15
Android Architecture
16
17
18
Mobile Applications
What
are they?
Types
19
Android Apps
Built
Java
Dalvik
http://developer.android.com/guide/developing/building/index.html#detailed-build
21
Android Architecture
23
24
Android Market
http://www.android.com/market/
Has
$25 fee
Link
to a Merchant Account
Google Checkout
Link to your checking account
Google takes 30% of app purchase price
26
27
Fast
Secure
Responsive
should be:
Seamless
ml
Great
reference!
29
Handset Alliance
Compare
Android Development
31
Android Development
Android
Development
process for an
Android app
33
http://developer.android.com/guide/developing/index.html
way
34
way
If not then
proceed with SDK
configuration.
Go to Window
Preferences and
set the SDK
location
You should get
36
37
38
on:
39
40
on AVD
41
Step 1
Step 2
42
Step 4
43
Step 6
44
45
Running
Hello World
application on your AVD
46
47
Android
Development
Explained
Two main
programming
component
XML Interface
Layout
(Activity)
Java code for
activity
48
49
50
51
52
Exercise 1
Simple
53
(2-b) Development
Double
54
(2-b) Development
(2-b) Development
Textview
hard coded
with and show on the
screen.
56
Exercise 2
Add
57
Explanation
2.
3.
60
63
Explanation
64
Development String
Manipulation
In
this exercise we are going to use our previous project (Button Click)
Modify the handleClick method as follow:
Run
the project
65
Development String
Manipulation
The result of string
manipulation where your
name is printed in reverse.
The use of build method
reverse for string
manipulation allow the input
string to reverse it content.
66
Development String
Manipulation advance
Further
67
codes given is
incomplete!!!.
Complete the code so that the
output from pressing the
button should display as in the
figure
68
Development Number
Manipulation
1. Start a new project and
name it Temperature
Converter
2. Change the form layout to
linear layout
3. Design the form layout as
in the figure
4. Run the form on your AVD
5. Add handleNom method
to your xml file. (where
and how??)
69
Development Number
Manipulation
6. Add the handleNom
method to your java
code. (where and
how??)
7. Run the program on
your AVD.
70
71
72
Hide
softkeyboard
Modify
Version
74
Date Picker
75
76
77
Input Control
Check Box
78
Input Control
Radio Button
79
Input Control
Toggle Button
80
Input Control
Spinner (dropdown
combo)
81
Input Control
Go back to your
interface xml layout
and select spinner.
Go to spinner
properties
Select Entries and
choose
planet_array from
Reference Chooser
Run the code
82
Input Control
83
Input control
Modify
codes in the
main class
84
Input Control
Seekbar
85
Input Control
Add
86
Create Menu
87
Create Menu
Menu
88
Alert Dialog
Add
89
Intent
1.
2.
Intent
Open
AndroidManifest.xml
and add the
following codes to
the xml
SecondActivity
refering to
SecondActivity.java
91
Intent
Make sure both java file contain onCreate method that calling the
correct xml layout file.
92
93
94
Browser
Call
96
Call
97
GPS
Calling
Google Maps
98
SMS
99
100
101
A math game
102
A math game
Add
103
A math game
Add
104
A math game
Tips
audio
106
Video
107
Notification
108
Simple Animation
http://mycodeandlife.wordpress.com/2012/07/
07/android-simple-animation/
109
Publishing Android
App
2.
3.
4.
Versioning
Beginning
1.
2.
3.
4.
5.
android:versionCode and
android:versionName
element)
android:label (within the <application>
element)
<application
android:icon=@drawable/icon
android:label=myFirst App>
Digital Signing
All Android applications must be digitally signed
before they are allowed to be deployed
You need not purchase digital certificates from a
certificate authority (CA)
You can generate your own self-signed certificate &
use it to sign your Android applications.
Eclipse uses a default debug keystore to sign your
application.
A keystore is commonly known as a digital certificate.
Specific
Steps
1. Select your project
2.
3.
Specific
Steps
4. Select your project
Specific Steps
5.
6.
7.
8.
9.
Specific
Steps
Provide an alias for
10.
11.
12.
Click Next.
Specific
Steps
13. Enter a path to store the destination
14.
APK file.
Click Finish.
2.
3.
4.
5.
Publishing
on
For publishing on
thethe Google Play
Android Market, you
need to pay a onetime registration fee,
currently U.S.$25.
Click the Google
Checkout button to
be redirected to a
page where you can
pay the registration
fee.
After paying, click the
Continue link.
Uploading
Your
You
will be asked
to
supply some details
for your application:
The application
in APK format
At least two
screenshots.
A high-resolution
application icon.
This size of this
image must be
512512 pixels.
APK Files