Inside Android: What Else Can You Do With Android?
Inside Android: What Else Can You Do With Android?
Inside Android
Chris Simmonds Embedded Linux Conference Europe 2010
Copyright 2010, 2net Limited
Inside Android
Overview
Inside Android
What is Android?
http://www.openhandsetalliance.com/ A group of (currently) 76 mobile network operators, handset manufacturers, silicon vendors and software companies Google is the key player, of course
Inside Android
An open source software stack Linux kernel with patches Apache/BSD licensed user space, mostly Java application framework
A set of Java apps (calendar, clock, etc.) Plus many more free and non-free apps
Google Market
Inside Android
Android internals
Inside Android
Inside Android
It is a standard implementation across all devices Good and well-documented application framework Good tools for developing and debugging Active development from OHA and community
Inside Android
Proposition
Android is not just for smart phones and tablets Also suitable for a wide range of devices
Battery-powered portable devices Devices with a touch screen Devices which require fast 2D and 3D graphics Test and Medical equipment Printers, building access, weighing scales ...
Inside Android
Non-mainline kernel
The framework (written in Java) is not compatible with Sun/Oracle Java SE or ME The C/C++ support is not full ANSI/POSIX
Inside Android
The SDK
For developing Java apps http://developer.android.com For writing native (C/C++) code http://developer.android.com All the open source components http://source.android.com
10
The NDK
Inside Android
Versions
Framework API level Gingerbread ? Froyo 8 Eclair 7 Eclair 5 Donut 4 Cupcake 3 Code name
Release date ?Oct 2010 May 2010 Jan 2010 Dec 2009 Sept 2009 Apr 2009
Inside Android
11
The SDK contains everything you need to write apps and test them using the emulator In this section I will show you how to
Download the SDK Create an AVD Start the emulator Log on to the emulated session using adb Install and use the Eclipse ADT plug-in
Inside Android
12
Download SDK starter pack from http://developer.android.com/sdk/index.html e.g. android-sdk_r06-linux_86.tgz Extract files Add the tools directory to your path Run android Select and install the platform(s) you will be developing for
Inside Android
13
Or graphically using the SDK and AVD manager (shown) Note the Skin section basically the screen resolution. The default is HVGA, 320 x 480
Inside Android
14
You can also add: -show-kernel to show Linux boot messages -shell to give a root shell prompt
Inside Android
15
Using adb
Android Debug Bridge A tool to connect to and interact with Android devices, including emulated ones Useful options for now
Inside Android
16
Adb example
$ adb devices List of devices attached emulator-5554 offline $ adb -s emulator-5554 shell # cat /proc/cpuinfo Processor : ARM926EJ-S rev 5 (v5l) BogoMIPS : 242.48 Features : swp half thumb fastmult vfp edsp java CPU implementer : 0x41 CPU architecture: 5TEJ CPU variant : 0x0 CPU part : 0x926 CPU revision : 5 Hardware : Goldfish Revision : 0000 Serial : 0000000000000000
Since there is only one device you can miss off the -s
$ adb shell #
Inside Android
17
logcat is a replacement for syslog Three logs: 'main' (default), 'radio', 'events'
$ adb logcat -b main I/DEBUG ( 30): debuggerd: Jun 30 2010 13:59:20 D/qemud ( 37): entering main loop I/Vold ( 28): Vold 2.1 (the revenge) firing up D/Vold ( 28): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media) I/Netd ( 29): Netd 1.0 starting ...
Inside Android
18
Real hardware
USB Network for production hardware you will need to enable Settings->Applications->Development->USB debugging and tick Settings->Applications>Development->Unknown sources
Note:
Inside Android
19
Inside Android
20
The ADT allows you to do everything mentioned so far in the Eclipse environment
Create AVDs Run the emulator Create projects Write and debug code
Inside Android
21
Installing ADT
Begin by installing Eclipse Then go to Help->Install new software Set the URL to Work with to
https://dl-ssl.google.com/android/eclipse/
Inside Android
22
ADT in action
Inside Android
23
Summary
The SDK contains everything you need to write apps and test them in the emulator or on real hardware
Inside Android
24