SlideShare a Scribd company logo
Android Development GeekCamp Singapore 22 nd  August 2009 Leong Hean Hong (CC) BY-SA Some rights preserved.
About Usernames: hongster, ahhong
DOB: 490204800 (GMT +8)
Work: LAMP | Android | iPhone
Interest: Python, Rubik Cube, Number Theory, Web Technologies
Groups: SG PHP User Group, KL Google Technology User Group
Content Intro
Development Tools
Setup
4 Component Types
Views
Intents
Demo
Intro Android  !=  OS “ Android™ delivers a complete set of software for mobile devices: an operating system, middleware and key mobile applications. ”
Android Architecture ( http://bit.ly/s73P2 )
Dalvik_VM  !=  JVM Designed and written by Dan Bornstein with contributions from other Google engineers
Bytecode on which it operates is not Java bytecode.
Development Tools Android 1.5 SDK
Optional, recommended Eclipse  (Java or RCP version recommended)
Android Development Tools ( ADT ) eclipse plugin (http s ://dl-ssl.google.com/android/eclipse/)
Setup Download and unzip Android SDK.
Install Eclipse.
Install ADT.
Set SDK path in Eclipse preference section.
Create Android Virtual Device ( AVD ).

More Related Content

PPT
21 android2 updated
ODP
Разработка приложений для Android Honeycomb: ActionBar & Fragments
PPTX
What's new in android jakarta gdg (2015-08-26)
PPT
Android tools
PDF
Android Screen Containers & Layouts
PPTX
行動App開發管理實務 unit1
PDF
01 08 - graphical user interface - layouts
PDF
Get Ready for Target SDK Version 29 and 30
21 android2 updated
Разработка приложений для Android Honeycomb: ActionBar & Fragments
What's new in android jakarta gdg (2015-08-26)
Android tools
Android Screen Containers & Layouts
行動App開發管理實務 unit1
01 08 - graphical user interface - layouts
Get Ready for Target SDK Version 29 and 30

What's hot (20)

PDF
01 09 - graphical user interface - basic widgets
PPT
Android
PDF
Android tutorial
DOCX
Android xml-based layouts-chapter5
PDF
Droidcon2013 pro guard, optimizer and obfuscator in the android sdk_eric lafo...
PDF
Android design patterns
PDF
Android Intro
PPT
Android tutorial
PPT
Android tutorial
PPT
Android tutorial
PDF
04 user interfaces
PPT
Android tutorial
PPTX
Android Development Made Easy - With Sample Project
PDF
Android layouts
PDF
Advance Android Layout Walkthrough
PDF
Android training day 3
PPT
Mobile app dev and android
PDF
Hierarchy viewer
PPT
Beginning Native Android Apps
PDF
Android TCJUG
01 09 - graphical user interface - basic widgets
Android
Android tutorial
Android xml-based layouts-chapter5
Droidcon2013 pro guard, optimizer and obfuscator in the android sdk_eric lafo...
Android design patterns
Android Intro
Android tutorial
Android tutorial
Android tutorial
04 user interfaces
Android tutorial
Android Development Made Easy - With Sample Project
Android layouts
Advance Android Layout Walkthrough
Android training day 3
Mobile app dev and android
Hierarchy viewer
Beginning Native Android Apps
Android TCJUG
Ad

Viewers also liked (19)

PPT
Android security
PDF
Developing MyTrafficCam
PDF
Go serving: Building server app with go
PPT
Writing An Expository Paragraph
PPT
PHP_Frameworks_Discussion
PPT
Figurative Language
PDF
Mobile Payment
PDF
Color filters for the dummies
PDF
Hacker Culture
PPTX
Building A Software Team
PDF
Webhook & Mailhook
PDF
Rubik Cubes For Geeks
PDF
What the HACK is HHVM?
PDF
Android and web services
PPT
Writing An Expository Paragraph
PPT
Writing An Expository Paragraph
PPTX
How to Plan & Execute a Seminar
Android security
Developing MyTrafficCam
Go serving: Building server app with go
Writing An Expository Paragraph
PHP_Frameworks_Discussion
Figurative Language
Mobile Payment
Color filters for the dummies
Hacker Culture
Building A Software Team
Webhook & Mailhook
Rubik Cubes For Geeks
What the HACK is HHVM?
Android and web services
Writing An Expository Paragraph
Writing An Expository Paragraph
How to Plan & Execute a Seminar
Ad

Similar to Geekcamp Android (20)

PDF
Advanced Android gReporter
PPTX
Building apps for multiple devices
PPTX
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
PPTX
Introduction To Google Android (Ft Rohan Bomle)
PPT
Intro to Android Programming
PPT
Developing in android
ODP
Android Development
PPTX
Introduction to Android Programming
PDF
Mobile Software Engineering Crash Course - C03 Android
PPT
Industrial Training in Android Application
KEY
Android Workshop
PDF
android level 3
PPT
Android Tutorial
PPT
Android dev
PPT
Android | Busy Java Developers Guide to Android: UI | Ted Neward
PPTX
Android Development project
PPTX
PPT
Migrating JavaME Apps to Android
PPT
Introduction to Android Fragments
PPTX
Holland9 Android Workshop Hogeschool Rotterdam
 
Advanced Android gReporter
Building apps for multiple devices
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Introduction To Google Android (Ft Rohan Bomle)
Intro to Android Programming
Developing in android
Android Development
Introduction to Android Programming
Mobile Software Engineering Crash Course - C03 Android
Industrial Training in Android Application
Android Workshop
android level 3
Android Tutorial
Android dev
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android Development project
Migrating JavaME Apps to Android
Introduction to Android Fragments
Holland9 Android Workshop Hogeschool Rotterdam
 

More from Hean Hong Leong (7)

PPTX
Telegram Bot
PDF
How To Work With UI/UX Designer
PPTX
How not to be a mediocre developer!
PDF
Gitflow Workflow
PPTX
Lazy Programmer's Guide To Writing Spec
PPTX
Developing Better Software
PDF
Do More With Message Queue
Telegram Bot
How To Work With UI/UX Designer
How not to be a mediocre developer!
Gitflow Workflow
Lazy Programmer's Guide To Writing Spec
Developing Better Software
Do More With Message Queue

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Lesson notes of climatology university.
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Classroom Observation Tools for Teachers
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
RMMM.pdf make it easy to upload and study
PPTX
Institutional Correction lecture only . . .
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharma ospi slides which help in ospi learning
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Complications of Minimal Access Surgery at WLH
PDF
Insiders guide to clinical Medicine.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Lesson notes of climatology university.
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Microbial diseases, their pathogenesis and prophylaxis
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Classroom Observation Tools for Teachers
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
human mycosis Human fungal infections are called human mycosis..pptx
Final Presentation General Medicine 03-08-2024.pptx
RMMM.pdf make it easy to upload and study
Institutional Correction lecture only . . .
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharma ospi slides which help in ospi learning
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Complications of Minimal Access Surgery at WLH
Insiders guide to clinical Medicine.pdf

Geekcamp Android

  • 1. Android Development GeekCamp Singapore 22 nd August 2009 Leong Hean Hong (CC) BY-SA Some rights preserved.
  • 4. Work: LAMP | Android | iPhone
  • 5. Interest: Python, Rubik Cube, Number Theory, Web Technologies
  • 6. Groups: SG PHP User Group, KL Google Technology User Group
  • 11. Views
  • 13. Demo
  • 14. Intro Android != OS “ Android™ delivers a complete set of software for mobile devices: an operating system, middleware and key mobile applications. ”
  • 15. Android Architecture ( http://bit.ly/s73P2 )
  • 16. Dalvik_VM != JVM Designed and written by Dan Bornstein with contributions from other Google engineers
  • 17. Bytecode on which it operates is not Java bytecode.
  • 19. Optional, recommended Eclipse (Java or RCP version recommended)
  • 20. Android Development Tools ( ADT ) eclipse plugin (http s ://dl-ssl.google.com/android/eclipse/)
  • 21. Setup Download and unzip Android SDK.
  • 24. Set SDK path in Eclipse preference section.
  • 25. Create Android Virtual Device ( AVD ).
  • 26. RTFM and start coding.
  • 28. Linux Tips Don’t use package manger, download Eclipse and unzip it.
  • 29. Use Sun Java ( “requires plug-in org.eclipse.wst.sse.ui” error )
  • 30. If installed Eclipse using root , update using root .
  • 31. Run <android-sdk>/tools/ddms once, before installing ADT. (solved in ADT 0.9.1 http://bit.ly/15FdZt )
  • 32. Application Components Activity Presents a visual UI for user to interact with.
  • 33. Similar to UIViewController. Service No visual UI, run in background for an indefinite period of time.
  • 34. Similar to daemon. Broadcast Receiver Does nothing but receive and react to broadcast announcements (E.g. Timezone changed, battery low, ...). Content Provider Makes a specific set of the application's data available to other applications. (E.g. Wrapper for data in file system or DB)
  • 35.  
  • 36. Android Project Folders src/ Source code. Android 1.5/ Library you will use. gen/ AIDL (Android Interface Definition Language), auto generated. asset/ Save data as asset when you need to read raw bytes.
  • 37. Android Project Files res/ (application resources access through R class) drawable/ (bitmap files)
  • 38. layout/ (design Views , similar to HTML)
  • 39. values/ (predefined values, can be referenced in application) AndroidManifest.xml Similar to iPhone’s Info.plist.
  • 40. Contains application settings (E.g. Intent filters, permission, activities, …) default.properties Contains project settings such as build target.
  • 42. Contains: LinearLayout for arranging subviews
  • 44. Button An ID (helloButton) is assigned to the button. Can be referenced through R.id.helloButton .
  • 45. Button text is defined in /res/values/string.xml .
  • 46. Add Button (main.xml) <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:orientation=&quot;vertical&quot; android:gravity=&quot;center&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot;> <TextView android:layout_width=&quot; wrap_content &quot; android:layout_height=&quot;wrap_content&quot; android:text=&quot;@string/hello&quot; /> <Button android:id=&quot;@+id/helloButton&quot; android:layout_width=&quot;wrap_content&quot; android:layout_height=&quot;wrap_content&quot; android:text=&quot;@string/hello_button&quot; /> </LinearLayout>
  • 47. Launch Image Gallery private static final int REQUEST_PICK_IMAGE = 1; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button)findViewById(R.id.helloButton); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Intent pickImage = new Intent(Intent.ACTION_PICK); pickImage.setType(&quot;image/*&quot;); startActivityForResult(pickImage, REQUEST_PICK_IMAGE); } }); }
  • 48. Intent Abstract description of an action to be preformed.
  • 49. Intent messaging is a facility for late run-time binding between components in the same or different applications.
  • 50. Activity , Service , BroadcastReceiver are activated through Intent .
  • 52. New Activity Create a new Activity called PhotoViewer
  • 53. Create a Layout to display the photo (photo_viewer.xml)
  • 54. Use a ImageView to display photo
  • 55. GoodByeWorld launch PhotoViewer by sending it an Intent
  • 56. The Intent contains the URI of the selected image
  • 57. ImageView load image from the URI
  • 58. /res/layout/photo_viewer.xml Layout for the PhotoViewer Activity
  • 59. Contains an ImageView for displaying image
  • 60. The ImageView is given an ID ( photoView )
  • 61. photo_viewer.xml <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:orientation=&quot;vertical&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot;> < ImageView android:id=&quot;@+id/photoView&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot; /> </LinearLayout>
  • 62. PhotoViewer.java protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView( R.layout.photo_viewer ); ImageView photoView = (ImageView)findViewById( R.id.photoView ); photoView.setImageURI( getIntent().getData() ); }
  • 63. AndroidManifest.xml <application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;> <activity android:name=&quot;.GoodByeWorld&quot; android:label=&quot;@string/app_name&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> <category android:name=&quot;android.intent.category.LAUNCHER&quot; /> </intent-filter> </activity> <activity android:name=&quot;.PhotoViewer&quot;></activity> </application>
  • 64. Create Menu private static final int MENU_RED = Menu.FIRST; private static final int MENU_GREEN = Menu.FIRST + 1; private static final int MENU_BLUE = Menu.FIRST + 2; private static final int MENU_RAND = Menu.FIRST + 3; public boolean onCreateOptionsMenu (Menu menu) { super.onCreateOptionsMenu(menu); menu.add(Menu.NONE, MENU_RED, Menu.NONE, &quot;Filter Red&quot;); menu.add(Menu.NONE, MENU_GREEN, Menu.NONE, &quot;Filter Green&quot;); menu.add(Menu.NONE, MENU_BLUE, Menu.NONE, &quot;Filter Blue&quot;); menu.add(Menu.NONE, MENU_RAND, Menu.NONE, &quot;Random Filter&quot;); return true; }
  • 65. Response to Menu Selection public boolean onMenuItemSelected (int featureId, MenuItem item) { super.onMenuItemSelected(featureId, item); switch(item.getItemId()) { case MENU_RED: photoView. setColorFilter (redFilter()); break; case MENU_GREEN: photoView. setColorFilter (greenFilter()); break; case MENU_BLUE: photoView. setColorFilter (blueFilter()); break; case MENU_RAND: photoView. setColorFilter (randFilter()); break; } return true; }
  • 67. ColorMatrixColorFilter private ColorMatrixColorFilter redFilter() { return new ColorMatrixColorFilter(new float[] { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0 }); }
  • 68. Q & A Any question?