Android app development: a top-down perspective
Upcoming SlideShare
Loading in...5
×
 

Android app development: a top-down perspective

on

  • 247 views

this slides describes a top-down perspective Android development process

this slides describes a top-down perspective Android development process

Statistics

Views

Total Views
247
Views on SlideShare
247
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Android app development: a top-down perspective Android app development: a top-down perspective Presentation Transcript

    • Android Applications: A top- down perspective Chao-Chueh Chang
    • Outline • Development environment • Components of an Android application • Debugging
    • Architecture of Android Java C/C++ C JNI
    • Development Environment • Java development kit (version 1.6 or higher) • Android SDK – Java classes for Android components • IDE – Google recommends Eclipse 3.4 or 3.5 • Android Development Tool (ADT) for Eclipse • Android NDK (optional) – Tool chain for compiling C/C++ into shared object files
    • Installing ADT/SDK/NDK • Installing ADT in Eclipse – Start Eclipse, then select Help > Install New Software – In the Available Software dialog, click Add... • In the Add Site dialog that appears, enter this URL in the "Location" field. – https://dl-ssl.google.com/android/eclipse/ • Or download the ADT plugin zip file and click Archive in the Available Software dialog – Next, next, next… • Configuring the Android SDK – Run Android SDK manager and download “SDK Platform” – Select Window > Preferences > Android – Browse and select your SDK directory • Add /path/to/your/ndk/directory/ to $PATH
    • Initializing a Project • File -> New -> Android Application Project • Helloworld!
    • Application Components • Application properties: AndroidManifest.xml – Presents essential information about the application • Resource xml files ( /res) – View layout, images, sounds, and etc… • Generated code ( /gen) – ADT generates a java file that includes resources and the corresponding ID • Source code ( /src , /jni ) – Generates shared object files through NDK – Generates .class files through eclipse • Object files ( /obj), Library files ( /libs)
    • Generating Application Resource files R.java *.java *.class *.dex .apk AndroidManifest C/C++ files *.so
    • Android Key Components • Activity – UI – One activity at a time • Service – May continue working even the application is not in the foreground – Expose method interface to Activity (like Java RMI) • Broadcast receiver – Listen to specific action(s) – IPC • Content provider – SQL-like
    • Activity Lifecycle • onCreate() – Set up activity layout • onStart() – Set event listener – Run methods – Initialize service or BroadcastReceiver • onStop() – Do cleaning methods
    • Service Lifecycle • onStart() – Initializing threads • onBind() – Passing parameters to this instance
    • Broadcast Receiver 1. Initialize IntentFilter 2. add actions 3. Initialize BroadcastReceiver and overrides onReceive 4. register 5. unregister IntentFilter filter = new IntentFilter(); Filter.addAction(WifiManager. WIFI_STATE_CHANGED_ACTION); BroadcastReceiver br = new BroadcastReceiver(){ onReceive(){ … } }; registerReceiver(br, filter); unregisterReceiver( br );
    • Compiling Codes Through NDK • Claim native methods in Java • Generates JNI header by javah • Write C/C++ program • Android.mk – include $(BUILD_SHARED_LIBRARY) • ndk-build
    • Android Virtual Device • Simulating events – Incoming calls, SMS… • No support for the following items – placing or receiving actual phone calls – USB connections – camera/video capture (input) – device-attached headphones – determining connected state – determining battery charge level and AC charging state – determining SD card insert/eject – Bluetooth
    • Debugging Tools • sdk/platform-tool/adb – adb logcat – ADT in Eclipse • addr2line, objdump, readelf