1 / 24

Android Training

Android Training. Nelson To. PreInstall Components . Android SDK • http://code.google.co... Java Standard Development Kit (JDK) version 5.0/6.0 (download) http://www.oracle.com... If you already have installed JDK 5.0/6.0, you can skip this. Eclipse Ganymede • http://eclipse.org/do...

jola
Download Presentation

Android Training

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android Training Nelson To

  2. PreInstall Components • Android SDK • http://code.google.co... • Java Standard Development Kit (JDK) version 5.0/6.0 (download) http://www.oracle.com... • If you already have installed JDK 5.0/6.0, you can skip this. • Eclipse Ganymede • http://eclipse.org/do... •  Eclipse ADT Plugin • https://dl-ssl.google...

  3. What is Android • Android is not an operating system • Android is build on top of Linux Kernel • Android is not equivalent to Linux Kernel • Android is an open source • Android devices sales 160,000 per day

  4. Android and Java • Android does not use the standard JVM • Android own its own JVM(Dalvik) • Android Dalvik vs standard JVM • register-based vs stack-based • more efficient and compact implementation • different set of java libraries than standard java libraries

  5. Android FrameWork Stack

  6. Android Linux Kernel • Hardware abstraction layer • Memory Management • Process Management • Networking • ...

  7. Android Native Libraries • Bionic • Surface Manager • 2D and 3D grahics • Media codecs • SQLite • WebKit • ...

  8. Android Framework • ActivityManager • Content providers • Resource manager • Location Manager • Notification Manager • ...

  9. Android Application • Android applications • google maps • facebook  • twitter • ...

  10. AndroidSDK • Tools • Docs • Platforms • Android XX • Data • Skins • Images • Samples • Add-ons • Google API

  11. Android Process and Thread • Linux process per application • One thread per process • UI Thread • manage Looper message

  12. Android Application Components • Activity • Service • Broadcast receiver • Content provider

  13. Android Activity • a single, focused thing that the user can do • takes care of creating a window for user • presentation to the user  • full-screen windows • floating windows • embedding inside of another activity • lifecycle • void onCreate(Bundle savedInstanceState)  • void onStart()   • void onRestart()   • void onResume()   • void onPause()   • void onStop()   • void onDestroy()

  14. Android Service •  to perform a longer-running operation while not interacting with the user • can be started and stopped • doesn't have UI • run by activities • implicit Service (binding service) • explicit Service (start service) • lifecycle • void onCreate()   • void onStart(Intent intent)   • void onDestroy()

  15. Android Content Provider • store and retrieve data and make it accessible to all applications • to share data across applications

  16. Android Broadcast Receiver • receive intents sent by sendBroadcast() • two type of broadcasts • Normal broadcast • Ordered broadcast

  17. Android Activity LifeCycle

  18. Android Intents • an abstract description of an operation to be performed • action • data • Explicit Intents (specified a component) • Implicit Intents 

  19. Hello World Project • Projec Name • Target • Application Name • Package name • Min SDK version

  20. Hello World Project • src • gen • Android XX • res • assets

  21. Hello World Project Manifest file <?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"      package="com.teach.helloworld"      android:versionCode="1"      android:versionName="1.0">    <application android:icon="@drawable/icon" android:label="@string/app_name">        <activity android:name=".helloworld"                  android:label="@string/app_name">            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>        </activity>    </application>    <uses-sdk android:minSdkVersion="4" /></manifest>

  22. Hello World Project Layout file <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    ><TextView      android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:text="@string/hello"    /></LinearLayout>

  23. Hello World Project Helloworld.java package com.teach.helloworld;import android.app.Activity;import android.os.Bundle;public class helloworld extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }}

  24. Hello World Project R.java package com.teach.helloworld;public final class R {    public static final class attr {    }    public static final class drawable {        public static final int icon=0x7f020000;    }    public static final class layout {        public static final int main=0x7f030000;    }    public static final class string {        public static final int app_name=0x7f040001;        public static final int hello=0x7f040000;    }}

More Related