Building an Android client Rohit Nayak Talentica Software
Agenda <ul><li>iPhone and the Mobile App Explosion </li></ul><ul><li>How mobile apps differ </li></ul><ul><li>Android phil...
The iPhone Phenomenon
http://en.wikipedia.org/wiki/File:IPhone_sales_per_quarter.svg
http://www.techcrunch.com/2009/10/21/how-the-iphone-is-blowing-everyone-else-away-in-charts/
Mobile Limitations <ul><li>Screen size </li></ul><ul><li>Battery Limitations </li></ul><ul><ul><li>CPU tick, memory refres...
Usage Traits  <ul><li>Universal, Always Available  </li></ul><ul><li>Small attention span </li></ul><ul><li>Interruptible ...
Motorola Droid
Motorola Droid <ul><li>Android 2.0, 256MB </li></ul><ul><li>4.56-by-2.36-inch, 0.54 inch thick, 6oz, 480-by-854-pixel, 6hr...
The Android mobile platform <ul><li>Linux 2.6 kernel </li></ul><ul><li>Dalvik VM (.dex, .apk) </li></ul><ul><li>Applicatio...
Core Applications <ul><li>Email client </li></ul><ul><li>SMS </li></ul><ul><li>Calendar </li></ul><ul><li>Maps </li></ul><...
Criticisms / Issues <ul><li>Not a std linux distribution </li></ul><ul><li>Not Java ME/SE, limited libraries </li></ul><ul...
Android Stack
Demo Android Contacts App
Application Framework <ul><li>Activity Manager: app life cycle, navigation stack </li></ul><ul><li>Views: layout, widgets ...
Key Building Blocks <ul><li>Activities </li></ul><ul><li>Services </li></ul><ul><li>Intents </li></ul><ul><li>Receivers </...
Intents <ul><li>Describes operation to be performed </li></ul><ul><li>Action / Data pair </li></ul><ul><ul><li>ACTION_VIEW...
Activities <ul><li>Application consists of activities </li></ul><ul><li>Interacts with user </li></ul><ul><li>Associated w...
Receivers <ul><li>Broadcast receivers (low battery, call, sms) </li></ul><ul><li>Intent Receivers </li></ul><ul><li>Intent...
 
Installing Dev Environment <ul><li>Java 5/6 </li></ul><ul><li>Eclipse </li></ul><ul><li>Android SDK </li></ul><ul><li>$PAT...
ADT Plugin <ul><li>Emulator, Device Controls </li></ul><ul><li>Android Virtual Device Manager </li></ul><ul><li>Dalvik Deb...
Demo App Preview
Poolster <ul><li>Online “football pools” application </li></ul><ul><li>Entities: Game, User </li></ul><ul><li>Game    Sta...
Inside Poolster <ul><li>Directory Structure </li></ul><ul><li>Manifest File </li></ul><ul><li>App Launching </li></ul><ul>...
Directory Structure <ul><li>/src </li></ul><ul><li>/res </li></ul><ul><ul><li>/drawable  (-ldpi, -hdpi) </li></ul></ul><ul...
AndroidManifest.xml <ul><li><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> </li></ul><ul><li><manifest xmlns:a...
The Main activity <ul><li>Intent  </li></ul><ul><ul><li>Action = android.intent.action.MAIN </li></ul></ul><ul><ul><li>Cat...
Layouts <ul><li>Absolute, Relative, Linear, Table </li></ul><ul><li>Dips vs pixels </li></ul><ul><li>Screen size/density <...
Inside Poolster - 2 <ul><li>REST Client </li></ul><ul><li>Xstream  </li></ul><ul><li>Internationalization </li></ul><ul><l...
Deploying <ul><li>Join Android Developer Program </li></ul><ul><li>Eclipse Android Tool “Export Signed Package” </li></ul>...
Resources <ul><li>http://developer.android.com </li></ul><ul><li>Professional Android Application Development (Wrox) </li>...
Thanks
Upcoming SlideShare
Loading in …5
×

Building an Android client

4,141 views

Published on

The iPhone revolutionized the world of mobile application development. However the iPhone’s proprietary hardware and software development environments are a roadblock to many.

Google’s Android platform with its promise of open standards for hardware and a free and familiar development environment make it a strong contender for competing with the iPhone platform.

After introducing the Android platform we will discuss the paradigms and constraints in building a mobile application. We then dissect a simple “social” Android application which uses a REST-based webservice to communicate. This will help us understand the core components of an Android application and the Android SDK functionality.

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,141
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
100
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Building an Android client

  1. 1. Building an Android client Rohit Nayak Talentica Software
  2. 2. Agenda <ul><li>iPhone and the Mobile App Explosion </li></ul><ul><li>How mobile apps differ </li></ul><ul><li>Android philosophy </li></ul><ul><li>Development Platform </li></ul><ul><li>Core Android Concepts </li></ul><ul><li>App Demo </li></ul><ul><li>App Dissection </li></ul>
  3. 3. The iPhone Phenomenon
  4. 4. http://en.wikipedia.org/wiki/File:IPhone_sales_per_quarter.svg
  5. 5. http://www.techcrunch.com/2009/10/21/how-the-iphone-is-blowing-everyone-else-away-in-charts/
  6. 6. Mobile Limitations <ul><li>Screen size </li></ul><ul><li>Battery Limitations </li></ul><ul><ul><li>CPU tick, memory refresh, screen lighting </li></ul></ul><ul><li>Speed </li></ul><ul><li>Memory </li></ul><ul><li>Keyboard </li></ul>
  7. 7. Usage Traits <ul><li>Universal, Always Available </li></ul><ul><li>Small attention span </li></ul><ul><li>Interruptible (calls, green light!) </li></ul><ul><li>GPS </li></ul><ul><li>Tap, Flick, Rotate, Pinch, Shake </li></ul><ul><li>Accelerometer </li></ul><ul><li>Voice, Texting </li></ul><ul><li>Handwriting recognition </li></ul><ul><li>Dropped calls, lack of coverage </li></ul>
  8. 8. Motorola Droid
  9. 9. Motorola Droid <ul><li>Android 2.0, 256MB </li></ul><ul><li>4.56-by-2.36-inch, 0.54 inch thick, 6oz, 480-by-854-pixel, 6hrs </li></ul><ul><li>Camera: 5MP/4X flash, video rec </li></ul><ul><li>Slide-out QWERTY keyboard </li></ul><ul><li>Mail: Gmail, MS Exchange </li></ul><ul><li>Google Maps Navigation </li></ul>
  10. 10. The Android mobile platform <ul><li>Linux 2.6 kernel </li></ul><ul><li>Dalvik VM (.dex, .apk) </li></ul><ul><li>Application framework </li></ul><ul><li>SQLite, Integrated browser (Webkit) </li></ul><ul><li>OpenGL graphics </li></ul><ul><li>Media support </li></ul><ul><li>GSM/CDMA, Wireless </li></ul><ul><li>Camera, GPS, Accelerometer </li></ul>
  11. 11. Core Applications <ul><li>Email client </li></ul><ul><li>SMS </li></ul><ul><li>Calendar </li></ul><ul><li>Maps </li></ul><ul><li>Contacts </li></ul>
  12. 12. Criticisms / Issues <ul><li>Not a std linux distribution </li></ul><ul><li>Not Java ME/SE, limited libraries </li></ul><ul><li>Apps run only from on-board memory </li></ul><ul><li>Version compatibility </li></ul><ul><li>Obsolete search results </li></ul>
  13. 13. Android Stack
  14. 14. Demo Android Contacts App
  15. 15. Application Framework <ul><li>Activity Manager: app life cycle, navigation stack </li></ul><ul><li>Views: layout, widgets </li></ul><ul><li>Content Providers: data storage/sharing </li></ul><ul><li>Resource Manager: strings, images </li></ul><ul><li>Notification Manager: alert mechanisms </li></ul>
  16. 16. Key Building Blocks <ul><li>Activities </li></ul><ul><li>Services </li></ul><ul><li>Intents </li></ul><ul><li>Receivers </li></ul><ul><li>Content Providers </li></ul>
  17. 17. Intents <ul><li>Describes operation to be performed </li></ul><ul><li>Action / Data pair </li></ul><ul><ul><li>ACTION_VIEW content://contacts/people </li></ul></ul><ul><ul><li>ACTION_DIAL content://contacts/people/4 </li></ul></ul><ul><ul><li>ACTION_DIAL tel:9822012345 </li></ul></ul><ul><li>Category (LAUNCHER, HOME, PREFERENCE) </li></ul><ul><li>Type (data mime type) </li></ul><ul><li>Extras (hashmap for custom data) </li></ul>
  18. 18. Activities <ul><li>Application consists of activities </li></ul><ul><li>Interacts with user </li></ul><ul><li>Associated with views </li></ul><ul><li>Requests data or services via Intents </li></ul><ul><li>Calls other activities </li></ul>Services <ul><li>Background process </li></ul><ul><li>MP3 player, polling sub-system </li></ul>
  19. 19. Receivers <ul><li>Broadcast receivers (low battery, call, sms) </li></ul><ul><li>Intent Receivers </li></ul><ul><li>Intents registered with Android </li></ul>Content Providers <ul><li>Share data with activities / services </li></ul><ul><li>Queries in the form of a URI </li></ul><ul><ul><li>content://contacts/people </li></ul></ul>
  20. 21. Installing Dev Environment <ul><li>Java 5/6 </li></ul><ul><li>Eclipse </li></ul><ul><li>Android SDK </li></ul><ul><li>$PATH </li></ul><ul><li>ADT plugin </li></ul><ul><li>Install Updates </li></ul>
  21. 22. ADT Plugin <ul><li>Emulator, Device Controls </li></ul><ul><li>Android Virtual Device Manager </li></ul><ul><li>Dalvik Debug Monitor Service </li></ul><ul><ul><li>Debugger, LogCat </li></ul></ul><ul><ul><li>File Explorer, Threads, Heap </li></ul></ul><ul><li>Physical Device Testing </li></ul>
  22. 23. Demo App Preview
  23. 24. Poolster <ul><li>Online “football pools” application </li></ul><ul><li>Entities: Game, User </li></ul><ul><li>Game  Stake, Option, Ends </li></ul><ul><li>To join User chooses an Option </li></ul><ul><li>REST Webservice backend </li></ul><ul><li>Clients: iPhone, Grails, Android, Silverlight </li></ul>
  24. 25. Inside Poolster <ul><li>Directory Structure </li></ul><ul><li>Manifest File </li></ul><ul><li>App Launching </li></ul><ul><li>Layout Files </li></ul><ul><li>Menu </li></ul>
  25. 26. Directory Structure <ul><li>/src </li></ul><ul><li>/res </li></ul><ul><ul><li>/drawable (-ldpi, -hdpi) </li></ul></ul><ul><ul><li>/layout (-small, -large, -land) </li></ul></ul><ul><ul><li>/menu </li></ul></ul><ul><ul><li>/raw </li></ul></ul><ul><ul><li>/values </li></ul></ul><ul><li>/bin .class, .dex, .apk </li></ul><ul><li>/gen R.java - constants </li></ul>
  26. 27. AndroidManifest.xml <ul><li><?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> </li></ul><ul><li><manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; </li></ul><ul><li>package=&quot;com.talentica.poolster&quot; </li></ul><ul><li>android:versionCode=&quot;1&quot; </li></ul><ul><li>android:versionName=&quot;1.0&quot;> </li></ul><ul><li><uses-permission android:name=&quot;android.permission.INTERNET&quot;></uses-permission> </li></ul><ul><li><application android:icon=&quot;@drawable/icon&quot; android:label=&quot;@string/app_name&quot;> </li></ul><ul><li><activity android:name=&quot;.Main&quot; </li></ul><ul><li>android:label=&quot;@string/app_name&quot;> </li></ul><ul><li><intent-filter> </li></ul><ul><li><action android:name=&quot;android.intent.action.MAIN&quot; /> </li></ul><ul><li><category android:name=&quot;android.intent.category.LAUNCHER&quot; /> </li></ul><ul><li></intent-filter> </li></ul><ul><li></activity> </li></ul><ul><li><activity android:name=&quot;.GamesList&quot; </li></ul><ul><li>android:label=&quot;@string/app_name&quot;> </li></ul><ul><li></activity> </li></ul><ul><li><activity android:name=&quot;.Login&quot; </li></ul><ul><li>android:label=&quot;@string/app_name&quot;> </li></ul><ul><li></activity> </li></ul><ul><li></application> </li></ul><ul><li><uses-sdk android:minSdkVersion=&quot;3&quot; /> </li></ul><ul><li></manifest> </li></ul>
  27. 28. The Main activity <ul><li>Intent </li></ul><ul><ul><li>Action = android.intent.action.MAIN </li></ul></ul><ul><ul><li>Category = android.intent.category.LAUNCHER </li></ul></ul><ul><li>Set layout </li></ul><ul><li>Initialise views </li></ul><ul><li>Set title, menu </li></ul><ul><li>Launching another activity </li></ul>
  28. 29. Layouts <ul><li>Absolute, Relative, Linear, Table </li></ul><ul><li>Dips vs pixels </li></ul><ul><li>Screen size/density </li></ul><ul><li>Landscape </li></ul><ul><li>Widgets: TextView , ListView, ImageView, EditText, RadioGroup, Gallery, Button </li></ul>
  29. 30. Inside Poolster - 2 <ul><li>REST Client </li></ul><ul><li>Xstream </li></ul><ul><li>Internationalization </li></ul><ul><li>Location, Maps </li></ul><ul><li>Database </li></ul><ul><li>Contacts </li></ul><ul><li>AdMobs Integration </li></ul>
  30. 31. Deploying <ul><li>Join Android Developer Program </li></ul><ul><li>Eclipse Android Tool “Export Signed Package” </li></ul><ul><li>Upload .apk file to Android Market </li></ul>
  31. 32. Resources <ul><li>http://developer.android.com </li></ul><ul><li>Professional Android Application Development (Wrox) </li></ul><ul><li>Android Application Development (O’Riley) </li></ul><ul><li>http://www.screaming-penguin.com/AndroidResources </li></ul>
  32. 33. Thanks

×