620 likes | 1.28k Views
Introduction of Android. Blackmore Hsiao & Steve Hu WGT1 2008/12/26. Outline. What is Android Android Architecture Development Environment of Android. What is Android. What is Android. Android is a ROBOT that looks completely human An Open Handset Alliance Project
E N D
Introduction of Android Blackmore Hsiao & Steve Hu WGT1 2008/12/26
Outline • What is Android • Android Architecture • Development Environment of Android
What is Android • Android is a ROBOT that looks completely human • An Open Handset Alliance Project • OHA members: 47 members currently • Mobile Operators: NTT, T-Mobile, Vodafone,… • Handset Manufacturers: HTC, Moto, SE, LG, … • Semiconductor Companies: Intel, Qualcomm, … • Software Companies: Google, eBay, …
What is Android • Software stack for mobile devices that includes an operating system, middleware and key applications • Using Java programming language to develop applications
Features • Application framework • Enabling reuse and replacement of components • Dalvik virtual machine • Optimized for mobile devices • Integrated browser • Base on the open source WebKit engine • Optimized graphics • Powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional) • SQLite • For structured data storage
Features • Media support • For common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF) • GSM Telephony • Hardware dependent • Bluetooth, EDGE, 3G, and WiFi • Hardware dependent • Camera, GPS, compass, and accelerometer • Hardware dependent • Rich development environment • Including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE
Android Architecture Middleware
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
Window Manager • Manage all the opened Window • public void removeViewImmediate(View view) • This is not for normal applications; using it correctly requires great care
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
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 • 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
Package Manager • Manage the application packages that are currently installed on the device
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
Resource Manager • Providing access to non-code resources such as localized strings, graphics, and layout files
Location Manager • Location information from GPS or Network • public LocationgetLastKnownLocation(String provider) • Then use the location to get latitude, longitude, altitude, speed, …etc
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
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
Dalvik Virtual Machine • Develop by Dan Bornstein • Named it after the fishing village of Dalvík in Eyjafjörður, Iceland • 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
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
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? BecauseIt’s already open source!
Agenda 為何使用Eclipse做為Android編輯環境 下載路徑 安裝Java Runtime Environment 安裝Android Eclipse Plugin 指定AndroidSDK位置 建立新專案與使用模擬器執行程式 Summary
用Eclipse開發Android的好處 1:免費 2:免費 3:免費
下載路徑 GO
下載路徑 1:下載 Google Android SDKhttp://code.google.com/android/download.html 2:下載 eclipsehttp://www.eclipse.org/downloads/ 3:下載JDKhttp://java.sun.com/javase/downloads/index.jsp