Getting Started With Android
Getting Started With Android
Colin Walls
colin_walls@mentor.com
Agenda
Introduction Android architecture Application development Android deployment Mentor Graphics support for Android Conclusions
2 www.mentor.com/embedded
What is Android?
An operating system for smart phones?
yes and no
What is Android?
Application
Application
Application Framework
Windows
DOS
DOS
4 www.mentor.com/embedded
What is Android?
Application
Application
Android
Linux
Linux
5 www.mentor.com/embedded
Android History
2005 2007 2008 2008 2009 Google acquires Android Inc. Open Handset Alliance announces Android First Android based handset launched Android source code released Mentor Graphics acquires Embedded Alley
6 www.mentor.com/embedded
Agenda
Introduction Android architecture Application development Android deployment Mentor Graphics support for Android Conclusions
7 www.mentor.com/embedded
Android Architecture
Linux
2.6.3x
115 patches required
provides:
process management memory management security networking drivers:
display, keypad, camera, WiFi, flash, audio, IPC, power
Linux
8 www.mentor.com/embedded
Android Architecture
Libraries
e.g.:
libc - bionic media libraries graphics SQLite
Libraries
Linux
9 www.mentor.com/embedded
Android Architecture
Android runtime
Dalvik VM Not a Java VM
register based
one instance per application memory optimized uses Linux to manage memory and multithreading
Libraries Android runtime
Linux
10 www.mentor.com/embedded
Android Architecture
Application framework
services and systems:
views content providers resource manager notification manager activity manager
Libraries Android runtime Application framework
11 www.mentor.com/embedded
Android Architecture
Applications
programs provided:
email SMS calendar Web browser contacts
Applications Application framework
Libraries
Android runtime
Linux
12 www.mentor.com/embedded
Agenda
Introduction Android architecture Application development Android deployment Mentor Graphics support for Android Conclusions
13 www.mentor.com/embedded
Development Environment
Eclipse based
Android Development Tools (ADT) plug-in Create an Android Virtual Device (AVD) Android Emulator
or
Target device
T-Mobile G1 Android Dev Phone 1 USB connection
Programming Model
All the resources for an application are bundled into an archive Android package Programs written in Java
run using Dalvik VM use non-standard, memory efficient bytecodes each program has its own Linux process data protected, but sharing possible
15 www.mentor.com/embedded
Programming Model
16 www.mentor.com/embedded
Programming Model
Activities
executable unit that performs specific function has UI application may have numerous activities one activity nominated as default [entry point]
Broadcast receivers
respond to broadcast messages
Content providers
makes applications data available to others can be: file system SQLite other
Services
similar to activity no UI runs in the background
targeted by
ContentResolver
17 www.mentor.com/embedded
Programming Model
Manifest file
describes components of an application structured XML file
called AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest . . . > <application . . . > <activity android:name="com.example.project.MyActivity . . . > </activity> . . . </application> </manifest>
18 www.mentor.com/embedded
Programming Model
Intents
asynchronous messages activate activities, services, and broadcast receivers for activities and services, specifies action and location of data applications have intent filters
19 www.mentor.com/embedded
Programming Model
Intent filters
describe what intent the components of an application can handle in manifest file
<application . . . > <activity android:name="com.example.project.MyActivity . . . > <intent-filter . . . > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> . . . </application>
20 www.mentor.com/embedded
Agenda
Introduction Android architecture Application development Android deployment Mentor Graphics support for Android Conclusions
21 www.mentor.com/embedded
22 www.mentor.com/embedded
Consumer
Telcom
Automotive
Medical
Home
White Goods
Not so easy
23 www.mentor.com/embedded
Medical
Automotive
White Goods
Telecom
Agenda
Introduction Android architecture Application development Android deployment Mentor Graphics support for Android Conclusions
26 www.mentor.com/embedded
The Embedded Alley approach Offer software and tools that precisely fit the customers product platform Maximize Open Source leverage for customers
27 www.mentor.com/embedded
29 www.mentor.com/embedded
Android Deployment
Enable Customers to build product specific applications, UI Produce product specific SDK and emulator Extending beyond handset assumptions Enable developing product and industry specific classes
Porting/optimizing for instruction sets Integrating with hardware acceleration Extending beyond handset assumptions Enable product and industry specific middleware
Libraries
Android runtime
Porting and optimizing Android Dalvik VM for CPU cores and SoCs
Linux
Providing Androidready Linux kernel Integrating and testing board support and industry-specific device drivers 30 www.mentor.com/embedded
Application Framework
Developing and adding product specific classes Enables customizing the UI, theme, and icons
Application SDK and Emulator (modified ADT, JDT Eclipse plug in)
Create product specific Application SDK Enables customizing the emulator to match the product (hardware, behavior and skins)
31 www.mentor.com/embedded
User documentation
32 www.mentor.com/embedded
Android Services
Custom board ports kernel and Android Extend Android I/O support with JNI and Class support Integrate product/industry specific middleware Turnkey solutions Application development Integration and Support services
33 www.mentor.com/embedded
Agenda
Introduction Android architecture Application development Android deployment Mentor Graphics support for Android Conclusions
34 www.mentor.com/embedded
Conclusions
Android is a disruptive technology
introduced for mobile phones much wider potential
Many challenges in wider Android deployment Mentor Graphics is committed to supporting developers who choose Android/Linux
35 www.mentor.com/embedded
Questions?
Colin Walls
colin_walls@mentor.com
blogs.mentor.com/colinwalls