Updated guide to Android Unit Testing

In this post we are going to get an overview of unit testing in Android with a few practical examples. Unfortunately, testing in Android has some pitfalls, which we will try to uncover in this tutorial. A lot of the confusion stems from the fact that Android testing has undergone major development changes in the recent past, and therefore there are various – and sometimes – conflicting resources online, which may be depreciated in the mean time. Before we delve deeper, let’s create a new Android project. We are using preview version 4 of Android Studio 2.0, which can be downloaded from here.

Start by creating a new project “Say Hello” with a Blank Activity.
01_new_project

Continue reading Updated guide to Android Unit Testing

Building and Deploying Vanilla/AOSP Android 4.4.4 for the Wandboard

In this post we are going to build and deploy Android Kitkat for the Wandboard Quad. The instructions are mostly identical for the Wandboard Dual, although you will need a different u-boot bootloader configuration, and a different dtb file. With the current Android 4.4.4 build we are able to use ethernet, wifi in client and AP mode, as well as ALSA sound. Bluetooth and hardware accelerated graphics is not yet accomplished.

  • Host Build System: Ubuntu 13.10 (64 Bit)
    It is important to use a 64 Bit version, otherwise, it is not possible to build Android.
  • Hardware: Wandboard Quad revision B1
  • Kernel version: 3.16 rc5
    We will use the latest kernel provided by Robert Nelson
  • Bootloader: u-boot bootloader by Denx
    We will also download and patch as per instructions provided by Robert Nelson.
  • Android version: 4.4.4_r1 AOSP
  • An USB to serial converter for communicating with the Wandboard
    Unless your computer has a serial port of course.
  • A microSD card
    We recommend at least class 10, it really makes a big difference. A size of 2GB should be enough.

For this tutorial, we will have 3 main source code repositories, namely Android, u-boot and Linux kernel sources. It is assumed that we download the Android source code, and place the u-boot and Kernel sources in their respective sub-folders “u-boot” and “armv7-multiplatform” inside the Android source‘s root. While the exact location does not matter, we will use /opt/android as an example here. Since we are going to use a cross-compiler from Android for building the bootloader, it makes sense to first download all the source code repositories before starting with this tutorial.

Continue reading Building and Deploying Vanilla/AOSP Android 4.4.4 for the Wandboard

Building and Deploying the Mainline (Vanilla) Android Master Source for the Beaglebone Black

Texas Instruments “AM335x” ARM platform has been gaining a lot of traction during the past couple of years. With the Beaglebone Black, a low cost board for developing on the platform is available. With the upcoming launch of the Arduino TRE which is based widely on the BBB, the platform is becoming even more interesting for the embedded industry.

In this post we would like to cover of how to get started with embedded Android development on the Beaglebone Black. While there are already excellent tutorials available of how to Build Yocto and Android Jellybean (based on the rowboat development project), this article covers building the Android Mainline (and vanilla) source code.

Continue reading Building and Deploying the Mainline (Vanilla) Android Master Source for the Beaglebone Black

Build and deploy Yocto Linux on the Beaglebone Black

This post will show you how to build and deploy the Yocto Linux distribution on the Beaglebone Black. Since the latest Yocto 1.6 “daisy” release, there is an official board support package for the Beaglebone. Therefore, the build process will be pretty straight-forward.

Prerequisites

On an Ubuntu 12.04, you will need at least the following packages

~$ sudo apt-get install chrpath gawk diffstat texinfo g++

Download the latest Yocto release branch “daisy”

~$ mkdir yocto
~$ cd yocto
~/yocto$ git clone -b daisy git://git.yoctoproject.org/poky.git

Continue reading Build and deploy Yocto Linux on the Beaglebone Black

Cross compiling Android’s adb and fastboot for embedded Linux (e.g. Yocto/OpenEmbedded)

The tools adb and fastboot are essential for debugging, managing and customizing Android devices. Both adb and fastboot are available for download within the ADT Bundle, however, those prebuilt binaries are for common host platforms (x86 and x86_64). What if you would like to run adb on a different architecture, such as ARM? There are of course multiple ways to get this done. Here we will show you how to cross compile adb and fastboot outside of the Android source tree using a standalone Makefile.

For this tutorial you will need

  • A cross compilation toolchain
    We will be using the official yocto project toolchain
  • Source files for adb and fastboot
    These will be in the platform/system/core and platform/system/extras repository from the official Android sources
  • Source files of three “external” projects
    Namely zlib, openssl and libselinux, which are also available from the official Android sources

Continue reading Cross compiling Android’s adb and fastboot for embedded Linux (e.g. Yocto/OpenEmbedded)

Technical Blog of Nexus-Computing GmbH Switzerland