SlideShare a Scribd company logo
1 of 60
Download to read offline
Android for
Embedded Linux Developers

      AnDevCon – March 9th 2011

   Karim Yaghmour / @karimyaghmour
About ...
●   Author of:




●   Introduced Linux Trace Toolkit in 1999
●   Originated Adeos and relayfs (kernel/relay.c)
1. Motivation
2. Stack Comparison
3. Android-Specific Concepts
4. Useful Embedded Linux Tricks
5. Pros and Cons
1. Motivation
●   Embedded Linux developers:
    ●   Developing Android apps
    ●   Porting apps
    ●   Creating custom Android device
●   Android developers:
    ●   Leverage Linux heritage
    ●   Learn embedded Linux tricks
    ●   Understand relation to embedded Linux
2. Stack Comparison
●   Starting point
●   Architecture
●   Requirements
●   Development approach
●   Development tools
●   Development environment
●   Bootloader
●   Kernel
●   Root filesystem
●   Startup
●   Default applications
●   Application development
2.1. Starting point - EL
●   Usually:
    ●   Bare/custom hardware
    ●   Create/building custom stack components
    ●   Lots of low-level work ahead (drivers, etc.)
    ●   No tools to start with
2.1. Starting point - Android
●   Usually – App dev:
    ●   Functional consumer-ready device
    ●   Fully-functional development environment
    ●   Distribution system for your app: Market
●   Exceptionally – Device dev:
    ●   Bare/custom hardware
    ●   Create/building custom stack components
    ●   Lots of low-level work ahead (drivers, etc.)
    ●   Fewer tools to start with
2.2. Architecture - EL
2.2. Architecture - Android
2.3. Requirements - EL
●   Minimal:
    ●   Linux workstation
    ●   GNU cross-development toolchain
    ●   Internet connection – download packages
●   Extras:
    ●   Distribution (free or $)
    ●   JTAG debugger
2.3. Requirements - Android
●   Minimal:
    ●   Windows / Mac / Linux workstation
    ●   JDK
    ●   Android SDK
    ●   Eclipse
●   Extras:
    ●   Android NDK
    ●   Android Open Source Project
2.4. Development approach - EL
1.Get a functional toolchain
2.Generate and “install” bootloader
3.Generate and “install” kernel
4.Create a basic functional root filesystem
5.Configure target to boot over NFS
6. ... Develop ...
7.Write root filesystem to flash
8.Ship
2.4. Development approach - Android
1.Create new project in Eclipse
2.Write application
3.Use emulator to debug
4.Test application on real device(S)
5.Ship
2.5. Development tools - EL
●   GNU cross-development toolchain:
    ●   gcc - compiler
    ●   as - assembler
    ●   ld - linker
    ●   gdb/gdbserver - debugger
    ●   etc.
●   C library: uClibc, eglibc or glibc
●   JTAG debugger
2.5. Development tools - Android
●   SDK:
    ●   android – manage AVDs and SDK components
    ●   apkbuilder – creating .apk packages
    ●   dx – converting .jar to .dex
    ●   adb – debug bridge
    ●   emulator – QEMU-based ARM emulator
    ●   ...
●   Eclipse w/ ADT plugin
●   NDK: GNU toolchain for native binaries
2.6. Development environment - EL
●   Editor/IDE:
    ●   vi
    ●   emacs
    ●   Eclipse
    ●   K Develop
●   CLI
●   Serial port emulator: minicom, C-Kermit, ...
2.6. Development env. - Android
●   Mainly:
    ●   Eclipse
    ●   Emulator
●   Maybe:
    ●   Favourite editor
    ●   CLI
    ●   adb
2.7. Bootloader - EL
●   U-Boot: PPC, ARM, x86, MIPS, SuperH, ...
    ●   CLI interface, serial-based
    ●   Environment variables, including built-in scripts
    ●   Evolved from forks and merges (8xxrom / PPCBoot / ARMBoot)
    ●   Very versatile and flexible bootloader
    ●   Actively maintained
    ●   Very mature
    ●   Supports a wide range of boot methods: TFTP, DHCP, IDE, SCSI,
        DOC, JFFS2, ...
    ●   Fairly well documented
    ●   Distributed under the terms of the GPL
2.7. Bootloader - Android
●   aosp/bootable/bootloader
    ●   Custom bootloader for Android
    ●   USB-based
    ●   Implements the “fastboot” protocol
    ●   Controlled via “fastboot” cli tool on host
●   aosp/bootable/recovery
    ●   UI-based recovery boot program
    ●   Accessed through magic key sequence at boot
    ●   Usually manufacturer specific variant
2.8. Kernel – EL
●   Stock kernel from kernel.org
●   May require porting to custom hardware
2.8. Kernel - Android
●   Android-specific patches:
    ●   Wakelocks
    ●   lowmem handler
    ●   Binder
    ●   Ashmem – anynoymous shared memory
    ●   RAM console
    ●   Logger
    ●   ...
2.9. Root filesystem - EL
●   /bin    =>   Essential user binaries
●   /boot   =>   Bootloader and kernel images
●   /dev    =>   Device files
●   /etc    =>   System configuration
●   /home =>     User home directories
●   /lib    =>   Essential shared libs and kernel modules
●   /mnt    =>   Temporary mount point
●   /opt    =>   Add-on software packages
●   /proc   =>   Virtual filesystem for kernel information
●   /sbin   =>   Essential system binaries
●   /sys    =>   Virtual filesystem for device access and information
●   /tmp    =>   Temporary files
●   /usr    =>   Secondary hierarchy (mostly user apps)
●   /var    =>   Variable data generated by daemons
2.9. Root filesystem - Android
●   Mainly
    ●   /data    => User data
    ●   /system => System components
●   Also found:
    ●   /cache
    ●   /mnt
    ●   /sbin
    ●   Etc.
2.10. Startup - EL
●   Software taking part in the system's startup:
    ●   Bootloader
    ●   Kernel
    ●   Init process
●   Bootloader:
    ●   First to run
    ●   Initializes hardware to a known state
    ●   Places kernel parameters for the kernel to find
    ●   Loads kernel and jumps to it
●   Kernel:
    ●   Early startup code is very hardware dependent
    ●   Initializes environment for the running of C code
    ●   Jumps to the architecture-independent start_kernel()
        function.
    ●   Initializes high-level kernel subsystems
    ●   Mounts root filesystem
    ●   Starts the init process
●   The init process takes care of loading all the user
    applications and starting the various daemons.
2.10. Startup - Android
●   Components involved
    ●   Bootloader
    ●   Kernel
    ●   Init
    ●   Zygote
    ●   System Server
    ●   Activity Manager
    ●   Launcher (Home)
●   Flash layout:
       0x000003860000­0x000003900000 : "misc"
       0x000003900000­0x000003e00000 : "recovery"
       0x000003e00000­0x000004300000 : "boot"        Kernel
       0x000004300000­0x00000c300000 : "system"      /system
       0x00000c300000­0x0000183c0000 : "userdata"    /data
       0x0000183c0000­0x00001dd20000 : "cache"       /cache
       0x00001dd20000­0x00001df20000 : "kpanic"
       0x00001df20000­0x00001df60000 : "dinfo"
       0x00001df60000­0x00001dfc0000 : "setupdata"
       0x00001dfc0000­0x00001e040000 : "splash1"
       0x000000300000­0x000001680000 : "modem"
                      From Acer Liquid-E
●   Android's init - opens, parses, and runs /init.rc:
    ●   Create mountpoints and mount filesystems
    ●   Set up filesystem permissions
    ●   Set OOM adjustments properties
    ●   Start daemons:
        –   adbd
        –   servicemanager (binder)
        –   vold
        –   netd
        –   rild
        –   app_process -Xzygote (Zygote)
        –   mediaserver
        –   ...
2.11. Default applications - EL
●   Busybox
     [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid,
     blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd,
     chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd,
     deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname,
     dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr,
     fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk,
     fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump,
     hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install,
     ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last,
     length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq, lpr,
     ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg,
     microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp,
     modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup,
     nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap,
     popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readahead, readlink,
     readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm,
     rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch,
     setconsole, setfont, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey,
     slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd,
     swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time,
     timeout, top, touch, tr, traceroute, traceroute6, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname,
     unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock,
     volname, wall, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat, zcip
2.11. Default applications - Android
    ● System Server
    ● Toolbox

    ● Native daemons

    ● Stock Android apps


/packages/apps                           /packages/providers      /packages/inputmethods

AccountsAndSettings   Launcher2          ApplicationProvider      LatinIME
AlarmClock            Mms                CalendarProvider         OpenWnn
Bluetooth             Music              ContactsProvider         PinyinIME
Browser               PackageInstaller   DownloadProvider
Calculator            Protips            DrmProvider
Calendar              Provision          GoogleContactsProvider
Camera                QuickSearchBox     MediaProvider
CertInstaller         Settings           TelephonyProvider
Contacts              SoundRecorder      UserDictionaryProvider
DeskClock             SpeechRecorder
Email                 Stk
Gallery               VoiceDialer
HTMLViewer
2.12. Application development - EL
●   Most apps:
    ●   C library
    ●   Unix systems programming
●   Window-based apps:
    ●   X window
    ●   Toolkits:
         –   Qt / GTK
    ●   Windowing systems:
         –   Qt Framework (formerly Qtopia)
         –   Gnome / KDE / Unity / etc.
2.12. Application dev. - Android
●   Android API
2.13. Application debugging - EL
●   gdb
●   strace
●   IDE integration
2.13. Application debugging - Android
●   adb
●   ddms
●   monkeyrunner
●   traceview
●   logcat
●   Eclipse integration
3. Android-specific Concepts
●   App fundamentals
●   Framework components
●   Native development
3.1. App fundamentals
●   Components
●   Intents
●   Component lifecycle
●   Manifest file
●   Processes and threads
●   Remote procedure calls
3.1.1. Components
●   1 App = N Components
●   Apps can use components of other applications
●   App processes are automagically started whenever any part
    is needed
●   Ergo: N entry points, !1, and !main()
●   Components:
    ●   Activities
    ●   Services
    ●   Broadcast Receivers
    ●   Content Providers
3.1.2. Intents
●   Intent = asynchronous message w/ or w/o
    designated target
●   Like a polymorphic Unix signal, but w/o
    required target
●   Intents “payload” held in Intent Object
●   Intent Filters specified in Manifest file
3.1.3. Component lifecycle
●   System automagically starts/stops/kills
    processes:
    ●   Entire system behaviour predicated on low memory
●   System triggers Lifecycle callbacks when
    relevant
●   Ergo: Must manage Component Lifecycle
●   Some Components are more complex to
    manage than others
3.1.4. Manifest file
●   Informs system about app’s components
●   XML format
●   Always called AndroidManifest.xml
●   Activity = <activity> ... static
●   Service = <service> ... static
●   Broadcast Receiver:
    ●   Static = <receiver>
    ●   Dynamic = Context.registerReceiver()
●   Content Provider = <provider> ... static
3.1.5. Processes and threads
●   Processes
    ●   Default: all callbacks to any app Component are issued to the main process thread
    ●   <activity>—<service>—<recipient>—<provider> have process attribute to override
        default
    ●   Do NOT perform blocking/long operations in main process thread:
        –   Spawn threads instead
    ●   Process termination/restart is at system’s discretion
    ●   Therefore:
        –   Must manage Component Lifecycle
●   Threads:
    ●   Create using the regular Java Thread Object
    ●   Android API provides thread helper classes:
        –   Looper: for running a message loop with a thread
        –   Handler: for processing messages
        –   HandlerThread: for setting up a thread with a message loop
3.1.6. Remote procedure calls
●   Apparently System V IPC is evil ...
●   Android RPCs = Binder mechanism
●   Binder is a low-level functionality, not used as-is
●   Instead: must define interface using Interface
    Definition Language (IDL)
●   IDL fed to aidl Tool to generate Java interface
    definitions
3.2. Framework components
●   UI
●   Data storage
●   Security/Permissions
●   ... and much more ... :
    ●    Graphics
    ●    Audio and Video
    ●    Location and Maps
    ●    Bluetooth
    ●    NFC
3.2.1. UI
●   Everything based on hierarchy of Views and
    ViewGroups (layouts)
●   Declared in XML or dynamically through Java
●   UI components:
    ●   Widgets
    ●   Event handlers
    ●   Menus
    ●   Dialogs
    ●   Notifications
    ●   ...
3.2.2. Data storage
●   Shared preferences
    ●   Private primitive key-pair values
●   Internal storage
    ●   Private data on device memory
●   External storage
    ●   Public data on shared external device (SD)
●   SQLite DB
    ●   Private DB
●   Network connection
    ●   Web-based storage (REST)
3.2.3. Security/Permissions
●   Most security enforced at process level: UID, GID
●   Permissions enforce restrictions on:
    ●   Per-process operations
    ●   Per-URI access
●   Applications are sandboxed
●   Specific permissions required to “exit” sandbox
●   Decision to grant access based on:
    ●   Certificates
    ●   User prompts
●   All permissions must be declared statically
3.3. Native development
●   What it can and cannot do
●   Getting and installing the NDK
●   Using the NDK
●   Implementing fully native apps
3.3.1. What it can and cannot do
●   Useful for:
    ●   Porting existing body of code to Android
    ●   Developing optimized native apps, especially for gaming
●   Provides:
    ●   Tools and build files to generate native code libraries from C/C++
    ●   Way to embed native libs into .apk
    ●   Set of stable (forward-compatible) native libs
    ●   Documentation, samples and tutorials
●   Enables:
    ●   Calling native code from Java using JNI
    ●   Implementing fully native apps (since 2.3)
●   Doesn't allow you to:
    ●   Compile traditional Linux/Unix apps as-is
3.3.2. Getting and installing the NDK
●   What’s in the NDK?
    ●   Development tools
    ●   Stable native APIs system headers
    ●   Documentation - IMPORTANT
    ●   Samples
●   Getting the NDK
    ●   http://developer.android.com/sdk/ndk/index.html
●   Prerequisites
    ●   Windows, Mac or Linux
    ●   Complete SDK
    ●   make (GNU’s) and awk
    ●   For Windows, Cygwin 1.7 or higher
●   NDK set up:
    ●   Make sure prerequisites are installed
    ●   Download and install NDK
3.3.3. Using the NDK
1.Place native code under <project>/jni/...
2.Create <project>/jni/Android.mk to describe native code
  to NDK
3.Optional: create <project>/jni/Application.mk for
  describing which natives sources are required by app
4.Build native code:
  •   cd <project>
  •   <ndk>/ndk-build
5.Compile app with SDK. Native code will be shared lib
  in .apk file.
3.3.4. Implementing fully native apps
●   Android 2.3 and up
●   Native lifecycle management
●   Still runs within context of dedicated Dalvik VM
●   Can use JNI to call on Java functions
●   Limited API:
    ●   Activity lifecycle management
    ●   Input events and sensors
    ●   Window management
    ●   Direct access to assets
●   Make sure your activity is called: “android.app.NativeActivity”
4. Useful Embedded Linux Tricks
●   crosstool-ng
●   Busybox
●   uClibc
4.1. crosstool-ng
●   Cross-development toolchain generator
●   Successor to crosstool
●   Available at:
     http://ymorin.is-a-geek.org/projects/crosstool
●   Downloads, patches, builds, installs, etc.
●   Comprises 23 steps
●   Menuconfig-based
●   Supports uClibc, glibc and eglibc
●   Supports ARM, Blackfin, MIPS, PowerPC, SH, …
●   Fairly well maintained
4.2. Busybox
●   Replicate Linux CLI experience
     [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid,
     blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd,
     chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd,
     deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname,
     dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr,
     fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk,
     fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump,
     hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install,
     ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last,
     length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq, lpr,
     ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg,
     microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp,
     modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup,
     nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap,
     popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readahead, readlink,
     readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm,
     rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch,
     setconsole, setfont, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey,
     slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd,
     swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time,
     timeout, top, touch, tr, traceroute, traceroute6, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname,
     unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock,
     volname, wall, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat, zcip
●   Some features of interest:
    ●   color-coded file lists
    ●   tab completion
    ●   "home", "end"
    ●   grep, sed, wc, more, less
    ●   vi
    ●   ifconfig
    ●   httpd
    ●   sendmail
    ●   tftp
    ●   top
    ●   ...
●   Download BusyBox (1.18.3)
●   Move to the directory for the rest of the setup:
    $ cd busybox-1.18.3

●   Configuration of BusyBox's options:
    $ make menuconfig

●   Options that must be set:
    ●   “Build Options” -> “Do you want to build BusyBox with a Cross Compiler?”
    ●   Cross-compiler prefix: arm-unknown-linux-gnueabi-
    ●   “Installation Options” -> “Don't use /usr”
    ●   Installation prefix: ${PRJROOT}/rootfs
●   Build:
    $ make

●   Install:
    $ make install
●   Cheat sheet:
       Commands to get the new Busybox onto the rootfs:
       adb shell mount -o remount,rw rootfs /
       adb shell mkdir /bin
       adb push busybox /bin/
       adb shell /bin/busybox --install /bin
       adb shell

       To do after going into the shell:
       /bin/ash
       export PATH=/bin:$PATH
4.3. uClibc
●   Originates from uClinux effort
●   Support both CPUs that have and those that
    lack an MMU and/or an FPU.
●   Allows both static and dynamic linking
●   Most applications that build with glibc will build
    and work the same with uClibc.
●   Available from: http://uclibc.org/
5. Pros and Cons
●   Target application type:
    ●   Stock Android vs. Custom Android
●   Development language
●   Licensing
●   Branding:
    ●   Do you care about the CTS?
Thank you ...



karim.yaghmour@opersys.com




     www.opersys.com

More Related Content

What's hot

Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Opersys inc.
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with PieOpersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)Siji Sunny
 
Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Tetsuyuki Kobayashi
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: IntroductionJollen Chen
 

What's hot (20)

Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Introduction to Android Window System
Introduction to Android Window SystemIntroduction to Android Window System
Introduction to Android Window System
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Embedded Android Workshop with Pie
Embedded Android Workshop with PieEmbedded Android Workshop with Pie
Embedded Android Workshop with Pie
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Deep Dive into the AOSP
Deep Dive into the AOSPDeep Dive into the AOSP
Deep Dive into the AOSP
 
Init of Android
Init of AndroidInit of Android
Init of Android
 
A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)A deep dive into Android OpenSource Project(AOSP)
A deep dive into Android OpenSource Project(AOSP)
 
Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'Android is NOT just 'Java on Linux'
Android is NOT just 'Java on Linux'
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Low Level View of Android System Architecture
Low Level View of Android System ArchitectureLow Level View of Android System Architecture
Low Level View of Android System Architecture
 
Android OS Porting: Introduction
Android OS Porting: IntroductionAndroid OS Porting: Introduction
Android OS Porting: Introduction
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 

Viewers also liked

Play With Android
Play With AndroidPlay With Android
Play With AndroidChamp Yen
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloadingArpita Gupta
 
Android Architecture
Android ArchitectureAndroid Architecture
Android ArchitectureLope Emano
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on AndroidGary Bisson
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Fuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidFuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidE Hacking
 
How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...Christoph Matthies
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overviewArjun Reddy
 
OpenGL ES 2.x Programming Introduction
OpenGL ES 2.x Programming IntroductionOpenGL ES 2.x Programming Introduction
OpenGL ES 2.x Programming IntroductionChamp Yen
 
RIL and Android Telephony
RIL and Android TelephonyRIL and Android Telephony
RIL and Android TelephonyLeaf Johnson
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Toursamrat das
 
Learning by hacking - android application hacking tutorial
Learning by hacking - android application hacking tutorialLearning by hacking - android application hacking tutorial
Learning by hacking - android application hacking tutorialLandice Fu
 
Android Radio Layer Interface
Android Radio Layer InterfaceAndroid Radio Layer Interface
Android Radio Layer InterfaceChun-Yu Wang
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC MechanismLihan Chen
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overviewRajKumar Rampelli
 

Viewers also liked (20)

Play With Android
Play With AndroidPlay With Android
Play With Android
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
 
Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
 
Accessing Hardware on Android
Accessing Hardware on AndroidAccessing Hardware on Android
Accessing Hardware on Android
 
How To Build Android for ARM Chip boards
How To Build Android for ARM Chip boardsHow To Build Android for ARM Chip boards
How To Build Android for ARM Chip boards
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Hacking Android OS
Hacking Android OSHacking Android OS
Hacking Android OS
 
Fuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidFuzzing the Media Framework in Android
Fuzzing the Media Framework in Android
 
How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...How to reverse engineer Android applications—using a popular word game as an ...
How to reverse engineer Android applications—using a popular word game as an ...
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overview
 
Udev
UdevUdev
Udev
 
OpenGL ES 2.x Programming Introduction
OpenGL ES 2.x Programming IntroductionOpenGL ES 2.x Programming Introduction
OpenGL ES 2.x Programming Introduction
 
RIL and Android Telephony
RIL and Android TelephonyRIL and Android Telephony
RIL and Android Telephony
 
Linux Kernel Tour
Linux Kernel TourLinux Kernel Tour
Linux Kernel Tour
 
Learning by hacking - android application hacking tutorial
Learning by hacking - android application hacking tutorialLearning by hacking - android application hacking tutorial
Learning by hacking - android application hacking tutorial
 
Android Radio Layer Interface
Android Radio Layer InterfaceAndroid Radio Layer Interface
Android Radio Layer Interface
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 

Similar to Android for Embedded Linux Developers

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVOpersys inc.
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIOpersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
Porting Android ABS 2011
Porting Android ABS 2011Porting Android ABS 2011
Porting Android ABS 2011Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VIOpersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VOpersys inc.
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 
Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut iiplarsen67
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Opersys inc.
 
embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdftwtester
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Opersys inc.
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesOpersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012Philip Polstra
 
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...melbats
 

Similar to Android for Embedded Linux Developers (20)

Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Leveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IVLeveraging Android's Linux Heritage at AnDevCon IV
Leveraging Android's Linux Heritage at AnDevCon IV
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Porting Android ABS 2011
Porting Android ABS 2011Porting Android ABS 2011
Porting Android ABS 2011
 
Leveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VILeveraging Android's Linux Heritage at AnDevCon VI
Leveraging Android's Linux Heritage at AnDevCon VI
 
Leveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon VLeveraging Android's Linux Heritage at AnDevCon V
Leveraging Android's Linux Heritage at AnDevCon V
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut ii
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
 
embedded-linux-120203.pdf
embedded-linux-120203.pdfembedded-linux-120203.pdf
embedded-linux-120203.pdf
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and Resources
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012The Deck by Phil Polstra GrrCON2012
The Deck by Phil Polstra GrrCON2012
 
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
EclipseCon Eu 2012 - Buildroot Eclipse Bundle : A powerful IDE for Embedded L...
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 

More from Opersys inc.

Android Automotive
Android AutomotiveAndroid Automotive
Android AutomotiveOpersys inc.
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals UpdateOpersys inc.
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security InternalsOpersys inc.
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with OreoOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoTOpersys inc.
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with NougatOpersys inc.
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave InternalsOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 

More from Opersys inc. (20)

Android Automotive
Android AutomotiveAndroid Automotive
Android Automotive
 
Android 10 Internals Update
Android 10 Internals UpdateAndroid 10 Internals Update
Android 10 Internals Update
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
Embedded Android Workshop with Oreo
Embedded Android Workshop with OreoEmbedded Android Workshop with Oreo
Embedded Android Workshop with Oreo
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Android Things: Android for IoT
Android Things: Android for IoTAndroid Things: Android for IoT
Android Things: Android for IoT
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Embedded Android Workshop with Nougat
Embedded Android Workshop with NougatEmbedded Android Workshop with Nougat
Embedded Android Workshop with Nougat
 
Brillo / Weave Internals
Brillo / Weave InternalsBrillo / Weave Internals
Brillo / Weave Internals
 
Project Ara
Project AraProject Ara
Project Ara
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Android for Embedded Linux Developers

  • 1. Android for Embedded Linux Developers AnDevCon – March 9th 2011 Karim Yaghmour / @karimyaghmour
  • 2. About ... ● Author of: ● Introduced Linux Trace Toolkit in 1999 ● Originated Adeos and relayfs (kernel/relay.c)
  • 3. 1. Motivation 2. Stack Comparison 3. Android-Specific Concepts 4. Useful Embedded Linux Tricks 5. Pros and Cons
  • 4. 1. Motivation ● Embedded Linux developers: ● Developing Android apps ● Porting apps ● Creating custom Android device ● Android developers: ● Leverage Linux heritage ● Learn embedded Linux tricks ● Understand relation to embedded Linux
  • 5. 2. Stack Comparison ● Starting point ● Architecture ● Requirements ● Development approach ● Development tools ● Development environment ● Bootloader ● Kernel ● Root filesystem ● Startup ● Default applications ● Application development
  • 6. 2.1. Starting point - EL ● Usually: ● Bare/custom hardware ● Create/building custom stack components ● Lots of low-level work ahead (drivers, etc.) ● No tools to start with
  • 7. 2.1. Starting point - Android ● Usually – App dev: ● Functional consumer-ready device ● Fully-functional development environment ● Distribution system for your app: Market ● Exceptionally – Device dev: ● Bare/custom hardware ● Create/building custom stack components ● Lots of low-level work ahead (drivers, etc.) ● Fewer tools to start with
  • 10. 2.3. Requirements - EL ● Minimal: ● Linux workstation ● GNU cross-development toolchain ● Internet connection – download packages ● Extras: ● Distribution (free or $) ● JTAG debugger
  • 11. 2.3. Requirements - Android ● Minimal: ● Windows / Mac / Linux workstation ● JDK ● Android SDK ● Eclipse ● Extras: ● Android NDK ● Android Open Source Project
  • 12. 2.4. Development approach - EL 1.Get a functional toolchain 2.Generate and “install” bootloader 3.Generate and “install” kernel 4.Create a basic functional root filesystem 5.Configure target to boot over NFS 6. ... Develop ... 7.Write root filesystem to flash 8.Ship
  • 13. 2.4. Development approach - Android 1.Create new project in Eclipse 2.Write application 3.Use emulator to debug 4.Test application on real device(S) 5.Ship
  • 14. 2.5. Development tools - EL ● GNU cross-development toolchain: ● gcc - compiler ● as - assembler ● ld - linker ● gdb/gdbserver - debugger ● etc. ● C library: uClibc, eglibc or glibc ● JTAG debugger
  • 15. 2.5. Development tools - Android ● SDK: ● android – manage AVDs and SDK components ● apkbuilder – creating .apk packages ● dx – converting .jar to .dex ● adb – debug bridge ● emulator – QEMU-based ARM emulator ● ... ● Eclipse w/ ADT plugin ● NDK: GNU toolchain for native binaries
  • 16. 2.6. Development environment - EL ● Editor/IDE: ● vi ● emacs ● Eclipse ● K Develop ● CLI ● Serial port emulator: minicom, C-Kermit, ...
  • 17. 2.6. Development env. - Android ● Mainly: ● Eclipse ● Emulator ● Maybe: ● Favourite editor ● CLI ● adb
  • 18. 2.7. Bootloader - EL ● U-Boot: PPC, ARM, x86, MIPS, SuperH, ... ● CLI interface, serial-based ● Environment variables, including built-in scripts ● Evolved from forks and merges (8xxrom / PPCBoot / ARMBoot) ● Very versatile and flexible bootloader ● Actively maintained ● Very mature ● Supports a wide range of boot methods: TFTP, DHCP, IDE, SCSI, DOC, JFFS2, ... ● Fairly well documented ● Distributed under the terms of the GPL
  • 19. 2.7. Bootloader - Android ● aosp/bootable/bootloader ● Custom bootloader for Android ● USB-based ● Implements the “fastboot” protocol ● Controlled via “fastboot” cli tool on host ● aosp/bootable/recovery ● UI-based recovery boot program ● Accessed through magic key sequence at boot ● Usually manufacturer specific variant
  • 20. 2.8. Kernel – EL ● Stock kernel from kernel.org ● May require porting to custom hardware
  • 21. 2.8. Kernel - Android ● Android-specific patches: ● Wakelocks ● lowmem handler ● Binder ● Ashmem – anynoymous shared memory ● RAM console ● Logger ● ...
  • 22. 2.9. Root filesystem - EL ● /bin => Essential user binaries ● /boot => Bootloader and kernel images ● /dev => Device files ● /etc => System configuration ● /home => User home directories ● /lib => Essential shared libs and kernel modules ● /mnt => Temporary mount point ● /opt => Add-on software packages ● /proc => Virtual filesystem for kernel information ● /sbin => Essential system binaries ● /sys => Virtual filesystem for device access and information ● /tmp => Temporary files ● /usr => Secondary hierarchy (mostly user apps) ● /var => Variable data generated by daemons
  • 23. 2.9. Root filesystem - Android ● Mainly ● /data => User data ● /system => System components ● Also found: ● /cache ● /mnt ● /sbin ● Etc.
  • 24. 2.10. Startup - EL ● Software taking part in the system's startup: ● Bootloader ● Kernel ● Init process ● Bootloader: ● First to run ● Initializes hardware to a known state ● Places kernel parameters for the kernel to find ● Loads kernel and jumps to it
  • 25. Kernel: ● Early startup code is very hardware dependent ● Initializes environment for the running of C code ● Jumps to the architecture-independent start_kernel() function. ● Initializes high-level kernel subsystems ● Mounts root filesystem ● Starts the init process ● The init process takes care of loading all the user applications and starting the various daemons.
  • 26. 2.10. Startup - Android ● Components involved ● Bootloader ● Kernel ● Init ● Zygote ● System Server ● Activity Manager ● Launcher (Home)
  • 27. Flash layout: 0x000003860000­0x000003900000 : "misc" 0x000003900000­0x000003e00000 : "recovery" 0x000003e00000­0x000004300000 : "boot" Kernel 0x000004300000­0x00000c300000 : "system" /system 0x00000c300000­0x0000183c0000 : "userdata" /data 0x0000183c0000­0x00001dd20000 : "cache" /cache 0x00001dd20000­0x00001df20000 : "kpanic" 0x00001df20000­0x00001df60000 : "dinfo" 0x00001df60000­0x00001dfc0000 : "setupdata" 0x00001dfc0000­0x00001e040000 : "splash1" 0x000000300000­0x000001680000 : "modem" From Acer Liquid-E
  • 28. Android's init - opens, parses, and runs /init.rc: ● Create mountpoints and mount filesystems ● Set up filesystem permissions ● Set OOM adjustments properties ● Start daemons: – adbd – servicemanager (binder) – vold – netd – rild – app_process -Xzygote (Zygote) – mediaserver – ...
  • 29. 2.11. Default applications - EL ● Busybox [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid, blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch, setconsole, setfont, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat, zcip
  • 30. 2.11. Default applications - Android ● System Server ● Toolbox ● Native daemons ● Stock Android apps /packages/apps /packages/providers /packages/inputmethods AccountsAndSettings Launcher2 ApplicationProvider LatinIME AlarmClock Mms CalendarProvider OpenWnn Bluetooth Music ContactsProvider PinyinIME Browser PackageInstaller DownloadProvider Calculator Protips DrmProvider Calendar Provision GoogleContactsProvider Camera QuickSearchBox MediaProvider CertInstaller Settings TelephonyProvider Contacts SoundRecorder UserDictionaryProvider DeskClock SpeechRecorder Email Stk Gallery VoiceDialer HTMLViewer
  • 31. 2.12. Application development - EL ● Most apps: ● C library ● Unix systems programming ● Window-based apps: ● X window ● Toolkits: – Qt / GTK ● Windowing systems: – Qt Framework (formerly Qtopia) – Gnome / KDE / Unity / etc.
  • 32. 2.12. Application dev. - Android ● Android API
  • 33. 2.13. Application debugging - EL ● gdb ● strace ● IDE integration
  • 34. 2.13. Application debugging - Android ● adb ● ddms ● monkeyrunner ● traceview ● logcat ● Eclipse integration
  • 35. 3. Android-specific Concepts ● App fundamentals ● Framework components ● Native development
  • 36. 3.1. App fundamentals ● Components ● Intents ● Component lifecycle ● Manifest file ● Processes and threads ● Remote procedure calls
  • 37. 3.1.1. Components ● 1 App = N Components ● Apps can use components of other applications ● App processes are automagically started whenever any part is needed ● Ergo: N entry points, !1, and !main() ● Components: ● Activities ● Services ● Broadcast Receivers ● Content Providers
  • 38. 3.1.2. Intents ● Intent = asynchronous message w/ or w/o designated target ● Like a polymorphic Unix signal, but w/o required target ● Intents “payload” held in Intent Object ● Intent Filters specified in Manifest file
  • 39. 3.1.3. Component lifecycle ● System automagically starts/stops/kills processes: ● Entire system behaviour predicated on low memory ● System triggers Lifecycle callbacks when relevant ● Ergo: Must manage Component Lifecycle ● Some Components are more complex to manage than others
  • 40. 3.1.4. Manifest file ● Informs system about app’s components ● XML format ● Always called AndroidManifest.xml ● Activity = <activity> ... static ● Service = <service> ... static ● Broadcast Receiver: ● Static = <receiver> ● Dynamic = Context.registerReceiver() ● Content Provider = <provider> ... static
  • 41. 3.1.5. Processes and threads ● Processes ● Default: all callbacks to any app Component are issued to the main process thread ● <activity>—<service>—<recipient>—<provider> have process attribute to override default ● Do NOT perform blocking/long operations in main process thread: – Spawn threads instead ● Process termination/restart is at system’s discretion ● Therefore: – Must manage Component Lifecycle ● Threads: ● Create using the regular Java Thread Object ● Android API provides thread helper classes: – Looper: for running a message loop with a thread – Handler: for processing messages – HandlerThread: for setting up a thread with a message loop
  • 42. 3.1.6. Remote procedure calls ● Apparently System V IPC is evil ... ● Android RPCs = Binder mechanism ● Binder is a low-level functionality, not used as-is ● Instead: must define interface using Interface Definition Language (IDL) ● IDL fed to aidl Tool to generate Java interface definitions
  • 43. 3.2. Framework components ● UI ● Data storage ● Security/Permissions ● ... and much more ... : ● Graphics ● Audio and Video ● Location and Maps ● Bluetooth ● NFC
  • 44. 3.2.1. UI ● Everything based on hierarchy of Views and ViewGroups (layouts) ● Declared in XML or dynamically through Java ● UI components: ● Widgets ● Event handlers ● Menus ● Dialogs ● Notifications ● ...
  • 45. 3.2.2. Data storage ● Shared preferences ● Private primitive key-pair values ● Internal storage ● Private data on device memory ● External storage ● Public data on shared external device (SD) ● SQLite DB ● Private DB ● Network connection ● Web-based storage (REST)
  • 46. 3.2.3. Security/Permissions ● Most security enforced at process level: UID, GID ● Permissions enforce restrictions on: ● Per-process operations ● Per-URI access ● Applications are sandboxed ● Specific permissions required to “exit” sandbox ● Decision to grant access based on: ● Certificates ● User prompts ● All permissions must be declared statically
  • 47. 3.3. Native development ● What it can and cannot do ● Getting and installing the NDK ● Using the NDK ● Implementing fully native apps
  • 48. 3.3.1. What it can and cannot do ● Useful for: ● Porting existing body of code to Android ● Developing optimized native apps, especially for gaming ● Provides: ● Tools and build files to generate native code libraries from C/C++ ● Way to embed native libs into .apk ● Set of stable (forward-compatible) native libs ● Documentation, samples and tutorials ● Enables: ● Calling native code from Java using JNI ● Implementing fully native apps (since 2.3) ● Doesn't allow you to: ● Compile traditional Linux/Unix apps as-is
  • 49. 3.3.2. Getting and installing the NDK ● What’s in the NDK? ● Development tools ● Stable native APIs system headers ● Documentation - IMPORTANT ● Samples ● Getting the NDK ● http://developer.android.com/sdk/ndk/index.html ● Prerequisites ● Windows, Mac or Linux ● Complete SDK ● make (GNU’s) and awk ● For Windows, Cygwin 1.7 or higher ● NDK set up: ● Make sure prerequisites are installed ● Download and install NDK
  • 50. 3.3.3. Using the NDK 1.Place native code under <project>/jni/... 2.Create <project>/jni/Android.mk to describe native code to NDK 3.Optional: create <project>/jni/Application.mk for describing which natives sources are required by app 4.Build native code: • cd <project> • <ndk>/ndk-build 5.Compile app with SDK. Native code will be shared lib in .apk file.
  • 51. 3.3.4. Implementing fully native apps ● Android 2.3 and up ● Native lifecycle management ● Still runs within context of dedicated Dalvik VM ● Can use JNI to call on Java functions ● Limited API: ● Activity lifecycle management ● Input events and sensors ● Window management ● Direct access to assets ● Make sure your activity is called: “android.app.NativeActivity”
  • 52. 4. Useful Embedded Linux Tricks ● crosstool-ng ● Busybox ● uClibc
  • 53. 4.1. crosstool-ng ● Cross-development toolchain generator ● Successor to crosstool ● Available at: http://ymorin.is-a-geek.org/projects/crosstool ● Downloads, patches, builds, installs, etc. ● Comprises 23 steps ● Menuconfig-based ● Supports uClibc, glibc and eglibc ● Supports ARM, Blackfin, MIPS, PowerPC, SH, … ● Fairly well maintained
  • 54. 4.2. Busybox ● Replicate Linux CLI experience [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64, basename, beep, blkid, blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk, fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last, length, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pwd, raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch, setconsole, setfont, setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true, tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch, watchdog, wc, wget, which, who, whoami, xargs, xz, xzcat, yes, zcat, zcip
  • 55. Some features of interest: ● color-coded file lists ● tab completion ● "home", "end" ● grep, sed, wc, more, less ● vi ● ifconfig ● httpd ● sendmail ● tftp ● top ● ...
  • 56. Download BusyBox (1.18.3) ● Move to the directory for the rest of the setup: $ cd busybox-1.18.3 ● Configuration of BusyBox's options: $ make menuconfig ● Options that must be set: ● “Build Options” -> “Do you want to build BusyBox with a Cross Compiler?” ● Cross-compiler prefix: arm-unknown-linux-gnueabi- ● “Installation Options” -> “Don't use /usr” ● Installation prefix: ${PRJROOT}/rootfs ● Build: $ make ● Install: $ make install
  • 57. Cheat sheet: Commands to get the new Busybox onto the rootfs: adb shell mount -o remount,rw rootfs / adb shell mkdir /bin adb push busybox /bin/ adb shell /bin/busybox --install /bin adb shell To do after going into the shell: /bin/ash export PATH=/bin:$PATH
  • 58. 4.3. uClibc ● Originates from uClinux effort ● Support both CPUs that have and those that lack an MMU and/or an FPU. ● Allows both static and dynamic linking ● Most applications that build with glibc will build and work the same with uClibc. ● Available from: http://uclibc.org/
  • 59. 5. Pros and Cons ● Target application type: ● Stock Android vs. Custom Android ● Development language ● Licensing ● Branding: ● Do you care about the CTS?