Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Android For Java Developers


Published on

This presentation was given at

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Android For Java Developers

  1. 1. Android for Java Developers Denver Java Users Group Jan 11, 2012 -Mike Wolfson @mikewolfson
  2. 2. Why Android? <ul><li>Open APIs – everyone’s equal </li></ul><ul><li>Low Barrier to entry </li></ul><ul><ul><li>Run app on your own device - $0 </li></ul></ul><ul><ul><li>Sell through Google Market - $25 </li></ul></ul><ul><li>Easy to develop apps </li></ul><ul><ul><li>Especially for Java Developers </li></ul></ul><ul><ul><li>Platform agnostic </li></ul></ul><ul><li>Open Market (or download from anywhere) </li></ul><ul><li>Feature Rich platform </li></ul>
  3. 3. Framework Overview <ul><li> </li></ul>
  4. 4. Framework – Linux Kernel <ul><li>Core system services </li></ul><ul><li>Handles security, memory management, process management, network access, etc </li></ul><ul><li>Abstraction layer between OS and hardware </li></ul>
  5. 5. Framework - Dalvik <ul><li>Virtual Machine </li></ul><ul><li>Optimized for mobile devices </li></ul><ul><li>Every app runs in its own instance of VM </li></ul><ul><li>Runs classes compiled by Java, and transformed into .dex files </li></ul>
  6. 6. Framework - Libraries <ul><li>Variety of libraries to provide built in functionality. </li></ul>
  7. 7. Framework – Application Framework <ul><li>Provides functionality to allow Applications to interact with underlying OS and other applications </li></ul><ul><li>Designed to simplify the reuse of components, and allow applications to publish, or make use of the capabilities of other applications </li></ul>
  8. 8. Framework – Applications <ul><li>The layer where custom-built applications live. </li></ul><ul><li>This is the place where most mobile developers will interact with Android. Your App Here! </li></ul>
  9. 9. Framework Overview
  10. 10. Get Developer Tools <ul><li>SDK </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li>Requires Java SDK (5.0 +) </li></ul></ul><ul><ul><li>Updating versions </li></ul></ul><ul><ul><li>What the different versions mean </li></ul></ul><ul><li>ADT Plugin (for Eclipse) </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li>Need Eclipse Ganymede (3.4+) </li></ul></ul><ul><ul><li>Update site: </li></ul></ul><ul><li>Can develop without Eclipse </li></ul>
  11. 11. Developer Tools (cont ) <ul><li>Android command </li></ul><ul><li>Emulator </li></ul><ul><ul><li>Android Virtual Devices (AVD) </li></ul></ul><ul><li>Android Debug Bridge (ADB) </li></ul><ul><ul><li>Command line tool for interacting with phone/emulator. </li></ul></ul><ul><li>Dalvik Debug Monitor Server (DDMS) </li></ul><ul><ul><li>Debugging tool providing: screen capture, memory info, logging, info spoofing) </li></ul></ul><ul><li> </li></ul>
  12. 12. Developing an App <ul><li>Create a new project </li></ul><ul><ul><li>Project content overview </li></ul></ul><ul><li>Code </li></ul><ul><li>Test on emulator (or device) </li></ul><ul><li>Debug </li></ul><ul><li>Sign </li></ul><ul><li>Export to device </li></ul><ul><ul><li>As APK ( A ndroid P ac K age file) </li></ul></ul>
  13. 13. Terminology <ul><ul><li>Most Commonly used elements </li></ul></ul><ul><ul><ul><li>Activity </li></ul></ul></ul><ul><ul><ul><li>Intent </li></ul></ul></ul><ul><ul><ul><li>Manifest file </li></ul></ul></ul><ul><ul><ul><li>Resources and Assets </li></ul></ul></ul><ul><ul><ul><li>Layout </li></ul></ul></ul><ul><ul><ul><li>Fragment </li></ul></ul></ul>
  14. 14. Terminology - Layout <ul><li>Layout – describes the UI of an activity </li></ul><ul><ul><li>Enables separation of UI from logic </li></ul></ul><ul><ul><li>There are a variety of layouts you can use including: Linear, Table, Relative, and Frame </li></ul></ul>
  15. 15. Terminology - Activity <ul><li>Activity – (Noun) A single screen, your application is made up of one or more of these. </li></ul><ul><ul><li>Always extends Activity </li></ul></ul>
  16. 16. Terminology - Intent <ul><li>Intent – (Verb) code to perform an action </li></ul><ul><ul><li>Wiring between activities, services, broadcast receivers, or other functions </li></ul></ul><ul><ul><li>facility for late run-time binding between components in the same or different applications </li></ul></ul><ul><ul><li>Rich set of Intent in Android provide excellent way of executing specific actions </li></ul></ul>
  17. 17. Fragments <ul><li>Fragments represent a behavior or portion of a UI. </li></ul><ul><li>Designed to collect a unit of UI and behavior into a reusable component </li></ul><ul><li>Don’t have own lifecycle – and must be embedded in an Activity </li></ul>
  18. 18. Fragments
  19. 19. Terminology - Manifest <ul><li>Manifest File – describes your app </li></ul><ul><ul><li>always named AndroidManifest.xml </li></ul></ul><ul><ul><li>declares the components of an application, describes security permissions required by the app, and lists required library dependencies </li></ul></ul>
  20. 20. Terminology - Resources <ul><li>Resource – text, pictures, sound, etc </li></ul><ul><ul><li>are all abstracted from the code and logic </li></ul></ul><ul><ul><li>compiled and managed by system generated R.class file </li></ul></ul><ul><ul><li>Instantiate by getting reference to object </li></ul></ul>
  21. 21. Resources <ul><li>Multiple Layouts and </li></ul><ul><li>Graphic Assets </li></ul><ul><li>Can also be Used for </li></ul><ul><li>language localization </li></ul><ul><li>Tip: use Density </li></ul><ul><li>Independent Pixels (DP) </li></ul><ul><li>Draw9Patch </li></ul>
  22. 22. Terminology - APK <ul><li>Android Application File </li></ul><ul><li>User can install apps from many sources </li></ul><ul><li>Developer can upload updates easily </li></ul>
  23. 23. Terminology – cont. <ul><ul><li>Other important elements </li></ul></ul><ul><ul><ul><li>Widget </li></ul></ul></ul><ul><ul><ul><li>Service </li></ul></ul></ul><ul><ul><ul><li>Broadcast Receiver </li></ul></ul></ul><ul><ul><ul><li>Security and Permission </li></ul></ul></ul><ul><ul><ul><li>Content Provider </li></ul></ul></ul>
  24. 24. Learn More <ul><li> </li></ul><ul><li>Denver Droids </li></ul><ul><ul><li> </li></ul></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li>Google Groups (Forums) </li></ul>
  25. 25. Questions? <ul><li>@mikewolfson </li></ul><ul><li>Google +: Mike Wolfson </li></ul><ul><li>[email_address] </li></ul><ul><li>Slideshare: </li></ul><ul><li>Dropbox: </li></ul><ul><li>Beer?! </li></ul>