Академический Документы
Профессиональный Документы
Культура Документы
Outline
I.Introduction to Android II.Android Programming III.Demonstration
I. Introduction to Android
What is Android?
operating system+middleware+applications
Android SDK provides tools and APIs Java Programming Language Extensible Markup Language (XML)
Android Features
Application framework Dalvik virtual machine Integrated browser Optimized graphics SQLite Media Support (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF) GSM Telephony Bluetooth, EDGE, 3G, WiFi Camera, GPS, compass, accelerometer
Applications
Email client, SMS program, calendar, maps, browser Views, Content Providers, Resource Mgr, Activity Mgr C lib, Media lib, Surface Mgr, SGL, 3D libs, FreeType Dalvik VM Version 2.6
Application Framework
Libraries
Android Runtime
Linux Kernel
App Fundamentals
Java compiled code+data+resources .apk (app) Each app lives in its own security sandbox
Activities
Services
Content Providers
manages a shared set of application data stored in the file system, SQLite db, web subclass of ContentProvider
Broadcast Receivers
Responds to system-wide broadcast announcements subclass of BroadcastReceiver and each broadcast delivered as Intent
no main() function
To activate a component in another app, tell system of intent to start the component
Pass an Intent to startActivity(), startActivityForResult() Pass an Intent to startService() Pass an Intent to sendBroadcast(), sendOrderedBroadcast() Perform a query() on a ContentResolver
AndroidManifest.xml Tells Android that the component being activated exists in the app All components must be declared here Must be at the root of the application project directory
Identify user permissions access contacts Declare minimum API Level Declare hardware and software features needed by app camera, accelerometer API libraries that needs to be linked Google Maps
intent actions describe the type of action to be performed and allow the system to find a component on the device intent filters identifies the components that can respond to an intent
Device characteristics
Screen size and density: <supports-screens> Input configurations: <uses-configuration> Device features: <uses-feature> Platform version: <uses-sdk>
App Resources
Intro (1)
Intro (2)
Intro (3)
android
Create and update Android projects and create, move, and delete AVDs. Run your Android applications on an emulated Android platform. Interface with your emulator or connected device
Android Emulator
Hardware profile Mapping to a system image Other options: skin, SD card Dedicated storage
Projects (1)
Android Projects,Test Projects,Library Projects src/ - stub Activity file bin/ output directory of build jni/ native code sources gen/ generated by ADT assets/ textures/game data
Projects (2)
anim/ - XML compiled to animation objects color/ - XML files that describe colors drawable/ - bitmaps layout/ - XML files compiled to screen layouts menu/ - application menus raw/ - assets values/ - others xml/ - misc XML files
Projects (2)
Build process Android projects are compiled and packaged into an .apk file
.dex - .class converted to Dalvik byte code Binary version of AndroidManifest.xml resources.arsc compiled resources uncompiled resources
Resources
http://developer.android.com
Demonstration