Introduction to Android

1,441 views

Published on

An introduction to the Android mobile operating system and programming framework. Example code at http://resume.jesse-anderson.com/introduction_to_android.zip.

Published in: Technology
  • Be the first to comment

Introduction to Android

  1. 1. Jesse Anderson
  2. 2.  Operating System for Mobile Devices  Based on modified Linux kernel  Middleware  Set of Applications  E-mail client  Browser  Released under Apache License
  3. 3.  Dalvik Virtual Machine  Webkit for Browser and Embeddable Object  2D and 3D (Open GL) graphics  SQLite for databases  Still Image Support (JPEG, GIF, PNG, BMP)  Video Support (H.263, H.264 AVC, MPEG-4 SP)  Audio Support (AAC, MP3, MIDI, Ogg Vorbis, PCM)
  4. 4.  Bluetooth  EDGE and 3G  WIFI (802.11 b/g/n)  WiMAX  Camera  GPS  Compass  Accelerometer
  5. 5.  Optimized for low memory  Register Based not Stack Based  Multiple VM instances at once  Compiled into dex files and apk package  JIT Compilation added in Android 2.2  No Java ME, AWT or Swing classes
  6. 6. Android iPhone SDK Programming Languages Java, C, C++, App Inventor, Mono, Interpreted Objective C App Market Wild West Gilded Cage App Submission Immediate Reviewed (HIG, legal) Device Makers Many Apple SDK Free/OSS ($25 listing) $100 Development Platforms Windows, Mac, Linux Mac OSX Distribution Restrictions None Provisioned Market Share 13% 24.4% UI Framework Android Cocoa Touch
  7. 7.  Application Package apk  Contains all data and resources needed  Components  Activity  Visual user interface for one focused endeavor  Service  Background task like music playback  Broadcast Receivers  Receive and react to broadcast announcements  Content Providers  Makes data available to other applications
  8. 8.  Activates Activities, Services, or Broadcast Receivers  Move between Activities in program  Initiate a phone call  Send an E-mail  Get broadcasts when battery is low
  9. 9.  Programmatically  Using POJO (Plain Old Java Objects)  Using XML (Preferred)  Layouts  Menus  Values  Resource Arrays  Colors  Dimensions  Strings  Styles
  10. 10.  Download and install Eclipse  Download and install Android SDK  Download Android Platforms and Components  Install ADT plug-in for Eclipse  http://developer.android.com/sdk/eclipse-adt.html
  11. 11.  Hello World as a POJO example
  12. 12.  R Class  Provides constants for accessing resources in strings.xml, colors.xml, layouts, etc  Generated code  Automatically handled on Eclipse using Android plug- in  Manually using Android tools
  13. 13.  UI Object from Layout  Provide Resource ID  android:id="@+id/uiObject“  (cast) findViewById(R.id.uiObject);  Strings  @string/myString  getString(R.string.myString);  Colors (ARGB)  @color/myColor  getResources().getColor(R.color.myColor);
  14. 14.  Hello World Using XML  Hello World Using XML and Resources
  15. 15.  Activities show a user interface  New activities must be registered in the AndroidManifest.xml file  Intents move between activities
  16. 16.  Hello World Using Intents and new Activities
  17. 17.  Android Developer Documentation  http://developer.android.com  Hello Android by Ed Burnette  Beginning Android by Mark L. Murphy  Google I/O Videos  http://developer.android.com/videos  http://code.google.com/events/io/2010/sessions.html

×