Android Internals

 

This course is intended for those who want to take an existing Android platform and customise or optimise it for their own needs.  Attendees will gain an insight into the inner working of Android using a combination of theory and hands-on lab sessions.  Customisations covered range from the simple, such as changing the boot animation, to the more complex such as adding native services and non-Android code.  On the optimisation front, they will find out how to use the Android NDK to call C/C++ code from aps, including how to detect and use the NEON co-processor for compute-intensive operations.

This course is ideal for software engineers who are familiar with embedded devices but need to apply that knowledge to Android development.

A-401
4 days
Available on Demand - please contact Feabhas
pdf download

Course Outline

Introduction to Android:

  • Getting started with the SDK and emulator
  • Using adb (Android debug bridge) to run a shell on the emulator
  • Getting the source code: the Android Open Source Project (AOSP)

Internal and external storage:

  • Files and directories: what goes where
  • File storage media: raw NAND flash, SD cards, eMMC and USB storage
  • The RAM disk

How Android boots:

  • The boot loader and the fast boot protocol
  • The init program and the init.rc boot script: detail of the boot stages and how to add your own native services
  • System properties: how they are defined and how to change them
  • How to create your own home screen

 Overview of Android Applications:

  • Application components: activities, services, broadcast receivers and content providers
  • Using the SDK to create and run a simple Java application
  • How Android creates a sandbox for each application using Linux processes, users and groups

Native code:

  • A look at what is included in the Android NDK
  • Using JNI to call C and C++ code from Java applications
  • Using gdb to debug native code
  • How to detect and use the NEON co-processor to optimise data manipulation

Native applications

  • Coding the application entirely in C/C++: pros and cons
  • Using OpenGL to display 2D and 3D graphics

Non-Android native code

  • Integrating code from outside Android, for example an open source web server
  • Methods of communicating with Android apps

Debug tools

  • adb in detail
  • Capturing and analysing application and kernel crashes

The kernel interface

  • Overview of the Android HAL (Hardware Abstraction Layer): lights and sensors
  • The input layer: touch screens, mice, keyboards and keypads
  • Power management: using wake locks to stay awake

Course Overview

 

Pre-requisites:

Essential

  • A good understanding of the C language
  • familiarity with Linux development and command-line tools.

Recommended

  • A working knowledge of Java would be useful.

Who should attend:

Software engineers and system architects.

Duration:

Four days

Course Materials:

Copies of the presentations and lab notes, plus sample code and worked solutions for the labs.

Related Courses:

Course Workshop:

An essential part of the training are the lab sessions, which take approximately 50% of the time. We normally work in pairs using a modern development board such as the Beaglebone. Each group will also need a laptop or desktop to run the system development tools. We will provide a bootable USB memory stick with an appropriate version of Linux and cross tool-chain so there is no need to install Linux beforehand.