Running Examples over the ADB

This method is still in the need for some testing, please report the developers if you found any issues with it.

The examples for the Mega ADK using the board over the Android Development Bridge (ADB) require the following hardware and software:

  • an Android phone supporting debug mode (as for 20110710 all Android devices can be configured to be used as development devices)
  • Android SDK with all the updates up to version 7 of the APIs
  • Processing 1.5
  • Arduino 0022 (or the latest stable release)
  • Oleg’s USB host shield library for Arduino modified (you can download it here)
  • Eclipse + ADT plugin (optional and not explained here)

1. Android SDK

You can get the Android SDK from the Android Development website:


Unless you are planning on using Eclipse as part of your development, you can skip their step 3 of the installation.

Step 4 can be time consuming, you need to include the APIs for Android’s core, as well as some of the Google add-ons and eventually the special third-party add-ons that apply to your device.

2. Processing + Processing Libraries

Processing can be obtained from the following link:


Download the appropriate version for your OS and run the application. The first time Processing will ask you for the location you want to place your sketchbook. This is the way Processing defines your workspace and where it will be storing all your work by default.

We need to add the examples you will use to the standard installation. Download this file to your Processing sketchbook folder and uncompress it there.

The next time you start Processing the examples you downloaded will be ready to use and will show up under Files → Sketchbook → ADB_Examples.

On the upper right corner of your application you will see a small button stating the work mode for Processing. By default you will be working on normal mode. Click on it to change to Android mode. That should also change the color of your application from grey to green.

You can now use the editor to write code for your phone. In order to launch your ADB compatible code, you should look for the Run on Device option from the Sketch menu.

Remember activating the “Android → Sketch Permissions → INTERNET” option from the menu, otherwise your phone will not be able of becoming a TCP server and this connection strategy will not work.

3. Arduino 0022 + Arduino Libraries

Download Arduino’s IDE from the following links. Note this is the stable branch of Arduino 0022 (note that the image here used corresponds to Arduino 0022), you could also use the latest stable release:

As with Processing, you need to run the IDE once to create your sketchbook folder. Once created, download this file. The folder, “libraries” needs to be placed in your Arduino sketchbook folder.

If you are using the same location as a previous Arduino installation, be careful to not overwrite the existing libraries folder. Add the “/libraries/ArduinoADB” folder as you would a regular library.


These tools require a particular process. You are writing code for two different pieces of hardware:

  • your phone/tablet, acting as ADB server over a TCP socket
  • your Mega ADK board, acting as ADB client communicating with the Android device

A good way of working could be to:

  1. write you Arduino sketch first
  2. make sure you are getting the data you want by debugging the code using the serial monitor
  3. write a basic Android App that reads the data or sends commands to the Mega ADK
  4. design your Android Application UI as needed