Professional Documents
Culture Documents
Android Development
for Embedded Systems
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?
Application Application
Application
Windows
Framework
DOS DOS
4
www.mentor.com/embedded
What is Android?
Application
Application
Open Source or
Proprietary
Middleware Android
glibc or uClibc
Linux Linux
5
www.mentor.com/embedded
Android History
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:
Linux
▪ display, keypad,
camera, WiFi, flash,
audio, IPC, power
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
Android
▪ memory optimized Libraries
runtime
10
www.mentor.com/embedded
Android Architecture
Application framework
▪ services and systems:
▪ views
▪ content providers Application framework
▪ resource manager
▪ notification manager
Android
▪ activity manager Libraries
runtime
11
www.mentor.com/embedded
Android Architecture
Applications
▪ programs provided:
Applications
▪ email
▪ SMS Application framework
▪ calendar
▪ Web browser
▪ contacts Libraries
Android
runtime
▪ all applications have the
same status
▪ Java programs Linux
▪ Uses standard Java tools
▪ Converted to Dalvik bytecode
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
▪ Only ARM devices
14
www.mentor.com/embedded
Programming Model
15
www.mentor.com/embedded
Programming Model
16
www.mentor.com/embedded
Programming Model
Activities Broadcast receivers
▪ executable unit that performs ▪ respond to broadcast
specific function messages
▪ has UI Content providers
▪ application may have ▪ makes application’s data
numerous activities available to others
▪ one activity nominated as ▪ can be:
default [entry point]
▪ file system
Services ▪ SQLite
▪ similar to activity ▪ other
▪ no UI ▪ targeted by
▪ runs in the background ContentResolver
17
www.mentor.com/embedded
Programming Model
Manifest file
▪ describes components of an application
▪ structured XML file
▪ called AndroidManifest.xml
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
Android is Designed for Mobile Phones
22
www.mentor.com/embedded
Android Experience on Any Platform?
Consumer Telcom
Automotive Medical
Not so easy…
23
www.mentor.com/embedded
Meaningful
Telecom Connections
Consumer
Medical
Automotive
Home
White Goods
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
27
www.mentor.com/embedded
Bridging the Smartphone Gap
28
www.mentor.com/embedded
Embedded Alley and Android
▪ Dramatically expands Android application
space
▪ Handheld multimedia
▪ Digital video
▪ Automotive
▪ Medical devices
▪ Home automation and SOHO networking
▪ Instrumentation and industrial control
29
www.mentor.com/embedded
Android Deployment
Enable Customers to
Extending beyond
build product specific
handset assumptions
applications, UI
Enable developing
Produce product Applications product and industry
specific SDK and
specific classes
emulator
Application framework
Porting and
optimizing Android
Dalvik VM for CPU
Android cores and SoCs
Porting/optimizing for
Libraries
runtime
instruction sets
Integrating with hardware
acceleration
Extending beyond Providing Android-
handset assumptions ready Linux kernel
Linux
Enable product and Integrating and testing
industry specific board support
middleware and industry-specific
device drivers
30
www.mentor.com/embedded
Development System for Android
31
www.mentor.com/embedded
Embedded Alley Development System
▪ Eclipse IDE for application development, tools and debug
▪ Latest stable gcc, binutils and gdb/gdbserver (CDT)
▪ Dnload app, console window, automatic debug connection (DSDP)
▪ Match Customer requirements and workflow
▪ Integration and build tool to create product specific runtime
▪ Build both proprietary code and open source components
▪ Control build type and flags - debug, code coverage, optimization levels,
CPU flags
▪ Integrate with customer workflow and source control
▪ Best practices and real world workflow
▪ Reproducible builds
▪ Software BoM, Source package, License Auditing and Traceability
▪ Multiple build targets - development, test, production, manufacturing
▪ User documentation
32
www.mentor.com/embedded
Android Services
▪ Introduction
▪ Android architecture
▪ Application development
▪ Android deployment
▪ Mentor Graphics support for Android
▪ Conclusions
34
www.mentor.com/embedded
Conclusions
35
www.mentor.com/embedded
Questions?
Colin Walls
colin_walls@mentor.com
blogs.mentor.com/colinwalls