Android Programming made easy

  • 12,484 views
Uploaded on

Overview of the Android Platform and its programming interface.

Overview of the Android Platform and its programming interface.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
12,484
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

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