Your SlideShare is downloading. ×
0
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Android Programming made easy
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Android Programming made easy

12,866

Published on

Overview of the Android Platform and its programming interface.

Overview of the Android Platform and its programming interface.

Published in: Technology
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
12,866
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
11
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Android Programming made easy<br />I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone<br />- BjarneStronstrup<br />
  • 2.
  • 3. About me – Lars Vogel <br />(Twitter: @vogella)<br />Independently active in the OpenSource Community, e.g. Eclipse and Android<br />Working for SAP AG as Product Manager<br />Maintains http://www.vogella.de Java, Eclipse and Android related Tutorials with ~15 000 visitors per<br />Received the Eclipse Top Contributor Award 2010<br />
  • 4. The next 58 minutes<br />Android overview<br />Android Tool chain<br />Demos<br />Android Programming Constructs<br />Q&amp;A<br />
  • 5. What is Android?<br />– operating system based on Linux<br />– middleware <br />– key applications <br />– set of APIs<br />Open Source <br />Developed officially by the Open Handset Alliance lead by Google<br />
  • 6. 4 Software layers<br />
  • 7.
  • 8. Dalvik – town in iceland<br />Android Programming<br />You use the Java programming language but Android does not run Java Bytecode<br />Tool dx converts Java Bytecode into Dalvik Executable Code (.dex)<br />
  • 9. Android Programming<br />You use the Java programming language but Android does not run Java Bytecode<br />
  • 10. Calls<br />Uses<br />
  • 11. Developer Toolchain<br />
  • 12. Android Development Tools (ADT) for Eclipse<br />Not OpenSource <br />Eclipse based tooling<br /><ul><li> Provide the emulator
  • 13. Wizard for creating new project
  • 14. Additional Tooling</li></li></ul><li>Emulator<br />QEMU-based ARM emulator runs same image as a device<br />Use same toolchain to work with device or emulatorInital startup is slooooowwwwww.....<br />
  • 15. Your first Android app in &lt; 60 secs<br />Timer check Application<br />
  • 16. Command lineadb – Android Debugging Bridgetelnet<br />
  • 17. Android programming <br />constructs <br />
  • 18. Main Android programming constructs<br />Activity<br />Views<br />Intents<br />Broadcast Receiver<br />Services<br />ContentProvider<br />
  • 19. Activity – screen in the Android application<br />Layout – Defines UI elements and their arrangements.<br />
  • 20. Life Cyle of an Activity<br />void onCreate(Bundle savedInstanceState) void onStart() void onRestart() void onResume() void onPause() void onStop() void onDestroy()<br />Android may destroy you!<br />
  • 21. Noteworthy:- ADT maintains the ID‘s automatically in R.java- Resources can be defined via xml <br />
  • 22. I had only the best intents....<br />
  • 23. Intents<br /><ul><li> Allow modular architecture
  • 24. Two types
  • 25. Explicit: Asking someone to do something
  • 26. Implicit: Asking the system who can do something </li></ul>Intent<br />
  • 27. Services<br />© Lars Vogel and others, Licensed under Creative Commons by-nc-nd-3.0 (de) <br />
  • 28. Services<br />Android provides a multitude of system services<br /><ul><li> NotificationService
  • 29. VibratorService
  • 30. LocationService
  • 31. AlarmService
  • 32. ....</li></ul>Access via context.getSystemService(Context.CONST);<br />You can define your own service.<br />
  • 33. Broadcast Receiver – Listen to system events <br />Example: <br />BATTERY_LOW, ACTION_BOOT_COMPLETED<br />Defined statically in manifest or temporary via code<br />
  • 34. Timer check ApplicationLets alert! <br />
  • 35. Security<br />
  • 36. Android Application requires explicit permissions, e.g. for <br /><ul><li>DB access
  • 37. Phone access
  • 38. Contacts
  • 39. Internet
  • 40. System messages</li></li></ul><li>Security is an inherent part of the system and not a layer the programmer needs to handle <br />
  • 41. There is more....<br />
  • 42. Android Connectivity<br />I can talk and hear<br />Internet (java.net, Apache HttpClient,...)<br />Bluetooth<br />Email<br />SMS<br />I have feelings<br />Camera API<br />Motion Detection<br />Location API (GIS)<br />Heat Sensor<br />Accelerator<br />
  • 43. Storage<br />File System (device or SD card)<br />Preferences<br />Database (SQLightDatabase)<br />
  • 44. Beyond Android – Google API‘s<br />
  • 45. Performance?<br />
  • 46. Performance Sins<br />Avoid creating objects<br />Static rules<br />Avoid to use internal setters and getter (within the same class)<br />Static final for constants<br />Learn on giants (use the libraries)<br />Details: http://developer.android.com/guide/practices/design/performance.html<br />
  • 47. Be fast!<br />Avoid ApplicationNotResponding Error<br />Threads not allowed to modify the UI directly<br />Use handler or AsyncTask to update the UI after Thread is done<br />
  • 48. Summary<br />Android powerful and well-designed development platform<br />Power to the developer<br />
  • 49. Picture Credit<br /> All pictures are from http://www.sxc.hu/ to get them add the number to http://www.sxc.hu/photo/<br />Agenda 1089869<br />Dalvik 1269657<br />Software Layer / Tomatos 832159<br />616474<br />Thinking guy 324541<br />Smiling Boy 812138<br />Toolchain 1197009<br />Stopwatch http://www.sxc.hu/photo/634598<br />Timer / Watches 1062014<br />Next guy 986700<br />Sad Lady 232738<br />Funny guy 1173019<br />Waiter / Services http://www.sxc.hu/photo/157966<br />Security 695054<br />There is more 702367<br /><ul><li>Performance rabbits 786444
  • 50. Performance snail 1181451
  • 51. Performance Running man 377100
  • 52. Hang-man 620961
  • 53. Summary http://www.sxc.hu/photo/1184807
  • 54. Question http://www.sxc.hu/photo/418215
  • 55. Reading material http://www.sxc.hu/photo/406547
  • 56. Thank you http://www.sxc.hu/photo/986313</li></li></ul><li>Android: Where to go from here:<br />Android Tutorial <br />http://www.vogella.de/articles/Android/article.html<br />Or Google for: ~1 rank<br />“android development tutorial”<br />
  • 57.
  • 58. Thank you<br />For further questions:<br />Lars.Vogel@gmail.com<br />http://www.vogella.de<br />http://www.twitter.com/vogella<br />
  • 59. License &amp; Acknowledgements<br />This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Germany License<br />See http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en_US<br />

×