49
NGN 期末報告 Google Android 介紹及程式撰寫 學生:徐志浩,張家豪 政治大學 / 資訊科學系 2009/05/27

NGN 期末報告 Google Android 介紹及程式撰寫

  • Upload
    juana

  • View
    149

  • Download
    9

Embed Size (px)

DESCRIPTION

NGN 期末報告 Google Android 介紹及程式撰寫. 學生:徐志浩,張家豪 政治大學 / 資訊科學系 2009/05/27. Outline. Android 來由與目的 架構說明 安裝及實作說明 應用程式展示 結論. Outline. Android 來由與目的 架構說明 安裝及實作說明 應用程式展示 結論. Android 是 …. Google 併購 Android 後所推出的手機 Linux 平台 目的是推廣一種手機應用程式開發架構,允許 OEM 手段大量製造手機服務. 其它特性. - PowerPoint PPT Presentation

Citation preview

  • NGN Google Android/2009/05/27

  • OutlineAndroid

  • OutlineAndroid

  • Android Google Android Linux

    OEM

  • Application framework Dalvik virtual machineJava Integrated browserWebKit Optimized graphicsSGL2DOpenGL ES 1.03D SQLite Media supportMPEG4,H.264,MP3,AAC,AMR,JPG,PNG,GIF GSMGSMAndroidGSM Bluetooth,EDGE,3G,and WiFi,Camera,GPS,compass,and accelerometerGSM Rich development environment,,Eclipse IDEAndroid

  • OutlineAndroid

  • Android Android(Software Stack) ()()()

  • (Applications)AndroidJava

  • (Application Framework) Views Systemlists,grids,text boxes,buttons, Content Providers()/Resource Manager() Resource Manager()(layout files) Notification Manager()(status bar)(alert) Android(short message)voice mail Activity Manager()(navigation backstack ) Window Manager() Location Manager Telephony Manager() Package ManagerAndroid XMMP ServiceineXtensible Messaging and Presence Protocol

  • (Libraries) System C LibraryMedia Libraries :OpenCORE Surface Manager: LibWebCore: SGL:Android2D3D libraries:OpenGL ES 1.0 API3D FreeType: SQLite:

  • (Android Runtime) Core Libraries JavaDalvikAndroidAndroidDalvik Dalvik Virtual MachineDalvikVMDalvikJavaJava BytecodeJava(Java Class File)Dalvik VMdex(Dalvik EXcutable).dexDalvik VMJava VMJava VMStack-basedDalvikregister-based Register-based VM VM JavaJavabytecodeJava VMStack Basedpush,popstackDelvik VMregister based

  • (Linux Kernel)Linux2.6AndroidLinux (Security)(Memory Management)(Process Management)(Network Stack)(Driver Model)(Abstraction Layer)

  • OutlineAndroid

  • Eclipseplug-inOS: Linux kernel - version 2.6 Emulator: on Mac, Windows, LinuxHardware support:GSM TelephonyBluetooth, 3G, and WiFiCamera, GPS and accelerometer

  • AndroidSun Java Development Toolkit ()Eclipse ADT plug-inAndroid SDK

  • IDE-EclipseJava Integrated Development EnvironmentDownload Site:http://www.eclipse.org/downloads/

  • Eclipse plug-in for Android-ADT Update Plug-in from Eclipse Site:[Software]->[add site]->[location]https://dl-ssl.google.com/android/eclipse/

  • OperationPlay Emulator Programming and Setting

    Remove Application

  • Play Emulator"File -> New -> Project "

  • Play EmulatorThis is the name of the directory that you want to contain the project a class can run and workthe title for the applicationmust be unique on an API

  • http://code.google.com/android/intro/tutorial.html

  • Play Emulator"Run -> Open Run Dialog"

  • Remove Application- adb shell # adb shell # cd data/app/ # ls ()NotesList.apkApiDemos.apk# rm NotesList.apk

    C:\Documents and Settings\\Local Settings\Application Data\Android\userdata.img

  • Android SDK http://developer.android.com/sdk/1.5_r2/index.html

  • Android SDKGoogel Android SDKAndroidLinuxAndroidEclipseAndroid Development Tools (ADT)APISample Code1.11.5

  • AndroidLinuxAndroid Linux KernelLinux 2.6 kernel. Android SDK 1.12.6.25CPUARM(T-Mobile G1)Qualcomm 528MHz256MB ROM192MB RAMAndroid Linux Kernel http://android.git.kernel.orgAndroid .apk, adb. Android Market

  • Androidx86ARMtelnet, adb(Android Debug Bridge)DDMS (Dalvik Debug Monitor Service)

  • %android%\tools%path%Android1.1Console, emulator skin HVGA-PAndroid1.5AVD (Android Virtural Device)console, android create avd --target 2 --name Emulator avd

  • ADB (Android Debug Bridge)adb shell (Linux console)adb install (adb install Hunter.apk)adb push / pull (adb push 1.jpg /sdcard)adb deviceDDMS (Dalvik Debug Monitor Service), Android, telnet(ls, rm, cd)Android, (, , GPS, , )

  • AndroidJava, Virtual MachinePorting, Sun. Core LibrariesDalvik Virtual MachineJava SRCJava BytecodeSun Runtime(Virtual Machine)Java SRCJava BytecodeDalvik Bytecode(.dex)Dalvik Runtime(Virtual Machine)CompileCompile

  • : Android Building BlocksAndroidManifest.xml activity Activity ActivityActivity Broadcast Intent Receiver Broadcast Intent ReceiverUINotificationManager Service ServiceUI Content Provider SQLite

  • Android ApplicationAndroid .apk, adb. Android Market

  • Android ApplicationActivity.Application(UI)(Res).

  • Android ProjectEclipseAndroid ProjectAndroidManifest.xmlAndroid projectsrc/ (java)res/anim ()res/drawable/ ()res/layout ()res/values (, )

  • Android Application Lifecycle1.Foreground process() - 2. visible process() - 3.Background process()4. empty process()5. service process()

  • Android-x86ARMtelnet, adb(Android Debug Bridge)DDMS (Dalvik Debug Monitor Service)

  • %android%\tools%path%Android1.1Console, emulator skin HVGA-PAndroid1.5AVD (Android Virtural Device)console, android create avd --target 2 --name Emulator avd

  • ADB (Android Debug Bridge)adb shell (Linux console)adb install (adb install Hunter.apk)adb push / pull (adb push 1.jpg /sdcard)adb deviceDDMS (Dalvik Debug Monitor Service), Android, telnet(ls, rm, cd)Android, (, , GPS, , )

  • OutlineAndroid

  • BMI()SOAP (Android)LBS

  • BMI()SOAP (Android)

    SDK

  • LBS&Q&A

  • step 1

  • step 2

  • step 3

  • step 4

  • OutlineAndroid

  • Google (Open Handset Alliance)NokiaSymbianQtWinME?LiMo Foundation iPhoneapi,Google Androidadobe flashAndroid View package

  • symbianwindows mobile1.5Vritual Device, SunJavaJavaSun, Android Java, Google JREAndroid 1. Activity 2. Broadcast Intent Receiver 3. Service 4. Content Provider AndroidManifest.xmlXML Android Manifest File Document(http://code.google.com/android/devel/bblocks- manifest.html ) XMLAndroidManifest.xml80ActivityXML 80 Activity Activity ActivitiesAndroidActivityActivityActivityView ActivityActivityActivity ActivityActivityActivity Android(Home) Intent and Intent Filters AndroidIntentIntentIntent MAIN()ViewPickEditURI IntentViewURI Intent FilterIntentIntent FilteractivityactivityIntent FilterACTION_VIEWIntent FilterAndroidManifest.xml resolving intentactivitystartActivity(myIntent) intent filtermyIntentstartActivityresolving Intents resolving Intent A. ActivitiesIntent B. ActivitiesActivity Broadcast Intent Receiver Broadcast Intent Receiver Broadcast Intent ReceiverBroadcast Intent ReceiverNotification Manager Broadcast Intent ReceiverAndrodiManifest.xml Context.registerReceiver()Broadcast Intent Receiver Broadcast ReceiversBroadcast Receivers Context.sendBroadcast()intent broadcast Service Service Service ActivitiesActivity Activity Content.startService() Content.bindService()ServiceServiceService ServiceService Content Provider Content Provider SQLite Content ProviderContent ProviderAccessing Content Providers(http://code.google.com/android/devel/data /contentproviders.html ) 1. foregroundprocess() - - onCreate()- onStart()- onResume() -, onResume()2. visible process() - - onPause()3. backgroundprocess()4. empty process()5. service process()1.5Vritual Device,