Introduction to Mobile Application Development on Android
-
Upload
julian-shen -
Category
Technology
-
view
1.792 -
download
1
description
Transcript of Introduction to Mobile Application Development on Android
![Page 1: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/1.jpg)
Introduction to Mobile Application Development on
Android
Julian Shen
![Page 2: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/2.jpg)
What’s th
is?A bird?
A plane?Not a Super man
either
![Page 3: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/3.jpg)
Smart Phone
![Page 4: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/4.jpg)
4
•Make a phone call
• Surfing internet
•Manage your schedule
• .....
A smart phone can
![Page 5: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/5.jpg)
5
Who uses smart phone?
Geeks?
Students?
Business man?
Young guys?
![Page 6: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/6.jpg)
Everybody could own oneThanks to Apple and iPhone
![Page 7: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/7.jpg)
So...now you may know
![Page 8: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/8.jpg)
Why should you develop a mobile
application?
It’s fun
Full of challengesMany people in the world may use it
Become famous? Maybe
把妹 ?!最好是把的到 !Make money
![Page 9: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/9.jpg)
What’s your target users?
EverybodyKnowing your users well
![Page 10: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/10.jpg)
But, there is one more thing you
should know
![Page 11: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/11.jpg)
11
It’s a phone not a PC
• Less memory, less computing power
• Battery is its food
• Internet connection is not always on and stable
• Some operations cost user money
• Lot of hardware combination
• Different screen size
• With/without GPS
• Capacitive/Resistive/No touch screen
• ....
![Page 12: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/12.jpg)
Application design philosophy
![Page 13: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/13.jpg)
13
What is a good mobile
application?
•Decent user interface
•Better performance
•Consume less power
![Page 14: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/14.jpg)
14
A Good User Interface
•Should be pretty but not only pretty
•Should be also
•Reasonable
•Predictable
•Responsive
•Easy to operate by fingers
![Page 15: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/15.jpg)
15
What you should avoid
• Complex and meaningless gestures
• Meaningless animations
• Inconsistent UI behaviors
• Too many operating steps
• Hidden steps
• Long run logic in UI thread
• Block user (Progress dialog is not so good)
• Any assumption
![Page 16: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/16.jpg)
16
Performance
•Always think about the worst case
•IO costs
•Network is slow
•Long run (or busy) process consumes battery
•Background is good but also evil
![Page 17: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/17.jpg)
You don’t like to see this
![Page 18: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/18.jpg)
![Page 19: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/19.jpg)
Introduction to Android
![Page 20: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/20.jpg)
20
Android is
•A mobile platform
•A Google’s product
•Linux + Java
•Source is available to public
![Page 21: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/21.jpg)
21
Version History•1.0 - Sep 2008
•1.1 - Feb 2009
•1.5 Cupcake - April 2009
•1.6 Donut - Sep 2009
•2.0/2.1 Eclair - Oct 2009 (2.0), Jan 2010 (2.1)
•2.2 Froyo - May 2010
•2.3(?) Gingerbread - 2010(?)
![Page 22: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/22.jpg)
Architecture
![Page 23: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/23.jpg)
23
Application Fundamentals
• By default, every application runs on its own process
• Applications could share process
• Each process has its own JVM
• By default, each application has a unique Linux UID
• It’s possible to share same UID for two different application
• Every process has its own memory limit
![Page 24: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/24.jpg)
24
Application Components
•Activities
•Services
•Broadcast receivers
•Content providers
![Page 25: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/25.jpg)
What you need before developing
an Android application?
![Page 26: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/26.jpg)
JAVA
![Page 27: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/27.jpg)
Eclipse
![Page 29: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/29.jpg)
SDK documentRead it online : http://www.android.com
![Page 30: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/30.jpg)
What else you might be
interested?
![Page 31: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/31.jpg)
Android Open Source
Check how to get it from http://source.android.com
![Page 32: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/32.jpg)
32
Why you might need Android
sources?•Android document sucks
•Trust no one! Truth is in the sources
•Many applications could be taken as examples
![Page 33: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/33.jpg)
33
Other way to develop
•Adobe AIR
•HTML
![Page 34: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/34.jpg)
First step to Android
![Page 35: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/35.jpg)
35
Create an Android project
•Specify project name
•Target platform
•Application properties
•Every application with UI starts from an Activity
![Page 36: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/36.jpg)
View Hierarchy
![Page 37: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/37.jpg)
37
Layout
•Create a new layout
•Add a button
•Assign an ID to this button
•Add on click action to this button
•Loading layout resource
•Accessing button from codes
![Page 38: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/38.jpg)
38
Application Resources
•Layout
•Drawables
•Strings
•Colors
•Styles
•...
![Page 39: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/39.jpg)
39
Run and Debug
•Create an AVD
•Run application
•Using DDMS
•Check UI hierarchy from hierarchy viewer
![Page 40: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/40.jpg)
Traceview
![Page 41: Introduction to Mobile Application Development on Android](https://reader036.fdocuments.in/reader036/viewer/2022081414/54c2da174a795943658b4646/html5/thumbnails/41.jpg)
May force be with you