A Noob’s Guide to Android Application Development By: Chua Zi Yong Singapore Android User Group www.codeandroid.org  BarCa...
Who am I? <ul><li>Student from NUS – Bioengineering  </li></ul><ul><li>Interest in mobile platforms </li></ul><ul><li>C pr...
What is in this presentation? <ul><li>Why Android? </li></ul><ul><li>How to Get Started? </li></ul><ul><li>“ Deep” Dive </...
Why Android? I am cool! By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
Why Android? <ul><li>Open Market Place </li></ul><ul><ul><li>Instant publishing and feedback! </li></ul></ul><ul><ul><li>Y...
Why Android? <ul><li>Background applications </li></ul><ul><ul><li>Finally useful apps </li></ul></ul><ul><ul><ul><li>fBoo...
Why Android? <ul><li>Develop on ANY platform FREE (no need to buy!) </li></ul><ul><ul><li>Windows </li></ul></ul><ul><ul><...
Why Android? <ul><li>Not just on mobile! </li></ul><ul><ul><li>Netbooks </li></ul></ul><ul><ul><li>MIDs </li></ul></ul><ul...
How to get started? Fix me! By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
How to get started? <ul><li>Things to install (developer.android.com) </li></ul><ul><ul><li>Java Developers Kit (JDK ) </l...
“ Deep” Dive By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
“ Deep” Dive <ul><li>Applications in Java </li></ul><ul><ul><li>Import Java libraries </li></ul></ul><ul><ul><li>Import An...
<ul><li>Starting an Application </li></ul><ul><li>Activity Lifecyle </li></ul><ul><ul><li>void onCreate </li></ul></ul><ul...
<ul><li>Applications Fundamentals </li></ul><ul><li>Activities (Application != Activity) </li></ul><ul><ul><li>What the us...
<ul><li>Applications Fundamentals </li></ul><ul><li>Intent </li></ul><ul><ul><li>Intent object holds the content of the me...
<ul><li>Example: PathFinder@SG extending ListActivity </li></ul>Package: com.pathfinder.sg CategoriesListActivity.java Pla...
Set view using ListAdapter  (since this is ListActivity) Starting GPS/ntw service Staring the Application: OnCreate  Andro...
Moving to Another Activity Using Intent By: Chua Zi Yong Singapore Android User Group www.codeandroid.org  Initialize inte...
Make sure you stop services that is not needed upon exit! i.e. GPS service will otherwise continue to run in background By...
By: Chua Zi Yong Singapore Android User Group www.codeandroid.org  Android Manifest User permission needed  Declare activi...
<ul><li>Applications Debugging </li></ul><ul><ul><li>DDMS in Eclipse using ADB </li></ul></ul>By: Chua Zi Yong Singapore A...
How to Publish? By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
How to Publish? <ul><li>Export and signing your app </li></ul><ul><ul><li>Export your application from Eclipse project </l...
How to Publish? <ul><li>Publishing on Android Market </li></ul><ul><ul><li>Sign up as an Android developer at developer.an...
How to Publish? <ul><li>Market Business Policies </li></ul><ul><ul><li>Payment - 70% developer 30% telco </li></ul></ul><u...
Resources By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
Resources <ul><li>Android Resources </li></ul><ul><ul><li>developer.android.com </li></ul></ul><ul><li>Open Source Codes f...
Resources <ul><li>GUI XML Tool for Android </li></ul><ul><ul><li>DroidDraw   </li></ul></ul><ul><li>Hacking/Flashing Andro...
Q&A By: Chua Zi Yong Singapore Android User Group www.codeandroid.org  ??
Upcoming SlideShare
Loading in …5
×

A Noob’S Guide To Android Application Development

17,504 views

Published on

Slides for Singapore BarCamp3

Published in: Education, Technology
5 Comments
41 Likes
Statistics
Notes
No Downloads
Views
Total views
17,504
On SlideShare
0
From Embeds
0
Number of Embeds
420
Actions
Shares
0
Downloads
0
Comments
5
Likes
41
Embeds 0
No embeds

No notes for slide

A Noob’S Guide To Android Application Development

  1. 1. A Noob’s Guide to Android Application Development By: Chua Zi Yong Singapore Android User Group www.codeandroid.org BarCamp Singapore 3 28/2/2009
  2. 2. Who am I? <ul><li>Student from NUS – Bioengineering </li></ul><ul><li>Interest in mobile platforms </li></ul><ul><li>C programming </li></ul><ul><li>sellAndroid != false (Google can pay me if they want =D); </li></ul><ul><li>Intent intent = new Intent(BarCamp3.this, ShareInterest.class); </li></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  3. 3. What is in this presentation? <ul><li>Why Android? </li></ul><ul><li>How to Get Started? </li></ul><ul><li>“ Deep” Dive </li></ul><ul><li>How to Publish? </li></ul><ul><li>Resources Available </li></ul><ul><li>Q&A </li></ul>
  4. 4. Why Android? I am cool! By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  5. 5. Why Android? <ul><li>Open Market Place </li></ul><ul><ul><li>Instant publishing and feedback! </li></ul></ul><ul><ul><li>You can create “ANYTHING” </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  6. 6. Why Android? <ul><li>Background applications </li></ul><ul><ul><li>Finally useful apps </li></ul></ul><ul><ul><ul><li>fBook notification! </li></ul></ul></ul><ul><ul><ul><li>Contextual based applications </li></ul></ul></ul><ul><ul><ul><li>… .. yourapp.apk </li></ul></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  7. 7. Why Android? <ul><li>Develop on ANY platform FREE (no need to buy!) </li></ul><ul><ul><li>Windows </li></ul></ul><ul><ul><li>Linux </li></ul></ul><ul><ul><li>Mac </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  8. 8. Why Android? <ul><li>Not just on mobile! </li></ul><ul><ul><li>Netbooks </li></ul></ul><ul><ul><li>MIDs </li></ul></ul><ul><ul><li>Desktop Phone?? </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  9. 9. How to get started? Fix me! By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  10. 10. How to get started? <ul><li>Things to install (developer.android.com) </li></ul><ul><ul><li>Java Developers Kit (JDK ) </li></ul></ul><ul><ul><li>Eclipse or any other IDE </li></ul></ul><ul><ul><li>Android SDK </li></ul></ul><ul><ul><li>Android Developers Tool (ADT) </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  11. 11. “ Deep” Dive By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  12. 12. “ Deep” Dive <ul><li>Applications in Java </li></ul><ul><ul><li>Import Java libraries </li></ul></ul><ul><ul><li>Import Android libraries </li></ul></ul><ul><ul><ul><li>GUI </li></ul></ul></ul><ul><ul><ul><li>Widgets </li></ul></ul></ul><ul><ul><ul><li>Animation </li></ul></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  13. 13. <ul><li>Starting an Application </li></ul><ul><li>Activity Lifecyle </li></ul><ul><ul><li>void onCreate </li></ul></ul><ul><ul><li>void onStart() </li></ul></ul><ul><ul><li>void onRestart() </li></ul></ul><ul><ul><li>void onResume()  </li></ul></ul><ul><ul><li>void onPause() </li></ul></ul><ul><ul><li>void onStop() </li></ul></ul><ul><ul><li>void onDestroy() </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive
  14. 14. <ul><li>Applications Fundamentals </li></ul><ul><li>Activities (Application != Activity) </li></ul><ul><ul><li>What the user see on the screen </li></ul></ul><ul><ul><li>1 app can have multiple activities </li></ul></ul><ul><ul><li>Draw using xml and call by Activity.setContentView() </li></ul></ul><ul><li>Services </li></ul><ul><ul><li>Runs in background indefinitely </li></ul></ul><ul><ul><li>E.g. music playback even when activity is stopped </li></ul></ul><ul><li>Broadcast receivers </li></ul><ul><ul><li>does nothing but receive and react to broadcast announcements </li></ul></ul><ul><ul><li>E.g. SMS receiver </li></ul></ul><ul><li>Content providers </li></ul><ul><ul><li>Data that can be accessed by the application </li></ul></ul><ul><ul><li>SQlite or any file system </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive
  15. 15. <ul><li>Applications Fundamentals </li></ul><ul><li>Intent </li></ul><ul><ul><li>Intent object holds the content of the message </li></ul></ul><ul><ul><li>E.g. intent is used when you want to start a new activity and intent will carry the name of the activity and content needed to be pass through </li></ul></ul><ul><li>Android Manifest </li></ul><ul><ul><li>Declaring the application's components e.g. libraries </li></ul></ul><ul><ul><li>Identifying any permissions the application expects to be granted </li></ul></ul><ul><ul><li>Mostly auto generated by ADT in Eclipse </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive
  16. 16. <ul><li>Example: PathFinder@SG extending ListActivity </li></ul>Package: com.pathfinder.sg CategoriesListActivity.java PlacesListActivity.java Services: MyPositionService .java (to obtain location from GPS, cell tower) Content Provider: xml file in /res/raw containing location data By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive
  17. 17. Set view using ListAdapter (since this is ListActivity) Starting GPS/ntw service Staring the Application: OnCreate Android logging class for logcat on DDMS (debugging) By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive
  18. 18. Moving to Another Activity Using Intent By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Initialize intent variable: Intent(packageContext,  Class) Start activity Add extended content to be passed through intent: putExtra(String name, value) Bonus point: If you intend to end current activity and back to previous, use finish() instead “ Deep” Dive
  19. 19. Make sure you stop services that is not needed upon exit! i.e. GPS service will otherwise continue to run in background By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Remember to consider other parts of the lifecycle “ Deep” Dive
  20. 20. By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Android Manifest User permission needed Declare activities within the application “ Deep” Dive
  21. 21. <ul><li>Applications Debugging </li></ul><ul><ul><li>DDMS in Eclipse using ADB </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org “ Deep” Dive
  22. 22. How to Publish? By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  23. 23. How to Publish? <ul><li>Export and signing your app </li></ul><ul><ul><li>Export your application from Eclipse project </li></ul></ul><ul><ul><li>Application will be exported as .apk </li></ul></ul><ul><ul><li>Sign myapp.apk with Keytool and Jarsigner (within JDK) </li></ul></ul><ul><ul><ul><li>Take note on validity date of private key during keygen – recommend at least “10000 days” </li></ul></ul></ul><ul><ul><li>http://developer.android.com/guide/publishing/app-signing.html </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org Suggested commands $ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -validity 10000 $ jarsigner -verbose -keystore my-release-key.keystore my_application.apk alias_name
  24. 24. How to Publish? <ul><li>Publishing on Android Market </li></ul><ul><ul><li>Sign up as an Android developer at developer.android.com </li></ul></ul><ul><ul><li>USD$25 sign up fee </li></ul></ul><ul><ul><li>Upload and monitor! </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  25. 25. How to Publish? <ul><li>Market Business Policies </li></ul><ul><ul><li>Payment - 70% developer 30% telco </li></ul></ul><ul><ul><li>Currently paid apps in UK and US </li></ul></ul><ul><ul><li>No obscene materials (porn etc) </li></ul></ul><ul><ul><li>24 hour return policy </li></ul></ul><ul><ul><li>Dispute resolution handled by developer and user directly </li></ul></ul><ul><ul><li>Google holds the right to remove application if found of violation </li></ul></ul><ul><ul><li>http://www.codeandroid.org/forum/?wpforumaction=viewtopic&t=1.0 </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  26. 26. Resources By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  27. 27. Resources <ul><li>Android Resources </li></ul><ul><ul><li>developer.android.com </li></ul></ul><ul><li>Open Source Codes for Android Application </li></ul><ul><ul><li>code.google.com/hosting/ </li></ul></ul><ul><li>Online Tutorials </li></ul><ul><ul><li>www.anddev.org </li></ul></ul><ul><li>Developers Group </li></ul><ul><ul><li>Google Group (Android Beginner, Developer, Discuss) </li></ul></ul><ul><ul><li>Codeandroid.org (Singapore Android User Group) </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  28. 28. Resources <ul><li>GUI XML Tool for Android </li></ul><ul><ul><li>DroidDraw </li></ul></ul><ul><li>Hacking/Flashing Android ROMs </li></ul><ul><ul><li>XDA Developers </li></ul></ul><ul><li>List of all applications on Android Market </li></ul><ul><ul><li>http://www.cyrket.com/ </li></ul></ul>By: Chua Zi Yong Singapore Android User Group www.codeandroid.org
  29. 29. Q&A By: Chua Zi Yong Singapore Android User Group www.codeandroid.org ??

×