Introduction of Android Blackmore Hsiao & Steve Hu WGT1 2008/12/26 Blackmore Hsiao & Steve Hu WGT1 2008/12/26
Qisda Confidential 2007 Outline What is Android Android Architecture Development Environment of Android
What is Android
Qisda Confidential 2007 What is Android Android is a ROBOT that looks completely human An Open Handset Alliance Project OHA members : 47 members currently OHA members Mobile Operators : NTT, T-Mobile, Vodafone,… Handset Manufacturers : HTC, Moto, SE, LG, … Semiconductor Companies : Intel, Qualcomm, … Software Companies : Google, eBay, …
Qisda Confidential 2007 What is Android Software stack for mobile devices that includes an operating system, middleware and key applications Using Java programming language to develop applications
Qisda Confidential 2007 Features 1. Application framework Enabling reuse and replacement of components 2. Dalvik virtual machine Optimized for mobile devices 3. Integrated browser Base on the open source WebKit engine 4. Optimized graphics Powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional) 5. SQLite For structured data storage
Qisda Confidential 2007 Features 6. Media support For common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF) 7. GSM Telephony Hardware dependent 8. Bluetooth, EDGE, 3G, and WiFi Hardware dependent 9. Camera, GPS, compass, and accelerometer Hardware dependent 10. Rich development environment Including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE
Android Architecture
Qisda Confidential 2007 Android Architecture Middleware
Qisda Confidential 2007 Android Architecture
Qisda Confidential 2007 Activity Manager An Activity is a chunk of code that does some work; it usually includes display UI to user, but not necessary Typically, you'll designate one of your application's Activities as the entry point to your application Manage the life cycle of applications and provides a common navigation backstack
Qisda Confidential 2007 Window Manager Manage all the opened Window public void removeViewImmediate (View view)View This is not for normal applications; using it correctly requires great care
Qisda Confidential 2007 Content Providers A content provider is a data storehouse Only required if you need to share data between multiple applications For example, the contacts data is used by multiple applications and must be stored in a content provider
Qisda Confidential 2007 View System View represents the basic UI building block A rich and extensible set of views: Lists, Grids, text boxes, buttons, and even an embeddeable web browser View-Gallery View-Gallery All of the views in a window are arranged in a single tree Implementing a Custom View : override methods when FocusChanged, key event, touch screen motion event, …etc happened
Qisda Confidential 2007 Package Manager Manage the application packages that are currently installed on the device
Qisda Confidential 2007 Telephony Manager Provide access to information about the telephony services on the device Application can register a listener to receive notification of telephony state changes
Qisda Confidential 2007 Resource Manager Providing access to non-code resources such as localized strings, graphics, and layout files
Qisda Confidential 2007 Location Manager Location information from GPS or Network public Location getLastKnownLocation (String provider)LocationString Then use the location to get latitude, longitude, altitude, speed, …etc
Qisda Confidential 2007 Notification Manager Enables all applications to display custom alerts in the status bar To tell the user that something has happened in the background Notification type Persistent icon that goes in the status bar Turning on or flashing LEDs Alerting the user by flashing the backlight, playing a sound, or vibrating
Qisda Confidential 2007 Android Architecture
Qisda Confidential 2007 Libraries Surface manager : Manage display and seamlessly composites 2D and 3D graphic OpenGL ES : 3D graphics SGL : 2D graphics Media Framework : support different media type FreeType : bitmap and vector font rendering SSL : Secure Socket Layer SQLite : lightweight database engine WebKit : browser engine Libc : standard C system library
Qisda Confidential 2007 Dalvik Virtual Machine Develop by Dan Bornstein Named it after the fishing village of Dalvík in Eyjafjörður, Iceland DalvíkEyjafjörðurIceland NOT a Standard Java Virtual Machine (JVM) Compile Java source code to compact.dex file, and then run on Dalvik VM Java class file need to use “ dx” tool compile to.dex file
Qisda Confidential 2007 Dalvik Virtual Machine Register -Based Architecture (cf. Stack- Based in JVM) which is designed for resource limited mobile device On Android, every Application runs in its own process, with its own instance of Dalvik VM
Qisda Confidential 2007 Android Architecture
Qisda Confidential 2007 Linux Kernal Linux 2.6 for core system services such as security, memory management, process management, network stack, and driver model Act as abstraction layer between hardware and the rest of software stack Why linux? Because It’s already open source!
Development Environment of Android
Qisda Confidential 2007 Agenda 為何使用 Eclipse 做為 Android 編輯環境 下載路徑 安裝 Java Runtime Environment 安裝 Android Eclipse Plugin 指定 Android SDK 位置 建立新專案與使用模擬器執行程式 Summary
Qisda Confidential 2007 為何使用 Eclipse 做為 Android 編輯環境 GO
Qisda Confidential 2007 用 Eclipse 開發 Android 的好處 1 :免費 2 :免費 3 :免費
Qisda Confidential 2007 下載路徑 GO
Qisda Confidential 2007 下載路徑 1 :下載 Google Android SDK :下載 eclipse :下載 JDK
Qisda Confidential 2007 安裝 Java Development Kit(JDK) GO
Qisda Confidential 2007 安裝 JDK(1)
Qisda Confidential 2007 安裝 JDK(2)
Qisda Confidential 2007 安裝 JDK(3)
Qisda Confidential 2007 安裝 JDK(4)
Qisda Confidential 2007 安裝 JDK(5)
Qisda Confidential 2007 安裝 Android Eclipse Plugin GO
Qisda Confidential 2007 在 Help 選單選擇 Software Updates
Qisda Confidential 2007 在 Available Software 選擇 Add Site
Qisda Confidential 2007 輸入 URL : ssl.google.com/android/eclipse/
Qisda Confidential 2007 勾選輸入的 URL
Qisda Confidential 2007 選擇 Install
Qisda Confidential 2007 選擇 Next
Qisda Confidential 2007 Accept the license agreement
Qisda Confidential 2007 Progressing
Qisda Confidential 2007 Restart
Qisda Confidential 2007 指定 Android SDK 位置 GO
Qisda Confidential 2007 選擇 Window 下的 Preferences
Qisda Confidential 2007 Browse to SDK Location
Qisda Confidential 2007 選擇確定
Qisda Confidential 2007 建立新專案與使用模擬器執行程式 GO
Qisda Confidential 2007 選擇 File 下 New->Project
Qisda Confidential 2007 選擇 Android Project
Qisda Confidential 2007 輸入參數
Qisda Confidential 2007 在專案名稱上按下滑鼠右鍵 ->Run As ->Android Application
Qisda Confidential 2007 Summary Eclipse 是免費的 IDE 。 安裝 JDK 安裝 Android Plugin 指向 Android SDK 建立新專案,使用模擬器執行程式。
Qisda Confidential 2007 Reference Documentation (Google Official) Google Android 裡頭有什麼? Google Android 裡頭有什麼? 史丹利部落格 : Android Architecture 史丹利部落格 : Android Architecture Android 架構說明 ( 上 ) Android 架構說明 ( 上 ) Android 架構說明 ( 中 ) Android 架構說明 ( 中 ) Android 架構說明 ( 下 ) Android 架構說明 ( 下 )