Google ADK + Android Phone Camera Trap (Spring 2011)

In a feat of great serendipity, luck, and magnificent timing, Google released its ADK/ADS this week, which fits perfectly with our camera trap project. And then, the Google gods smiled down upon us, when Diana’s brother managed to finagle an ADK from the Google I/O conference and sent it to us (never have we been so excited to receive a package–like children on Xmas! if I was Christian). Following the steps on the Android developer site, we got the Google ADK to communicate with the Android phone. Some important points that are hidden deep in the Android Developer instructions:

1. Gingerbread 2.3.4 is NECESSARY to work with the ADK. This works only on the Google Nexus One and the Google Nexus S (make sure to update over the air on Google Nexus One as it is not pre-set). This can be done in the Settings section of the phone.

2. Set permissions on the phone: Settings–>Applications–>Development–>Turn on “USB debugging”. Allows you to access the USB, which is how the phone communicates with the board. The phone will not be detected on your computer.

3. The phone needs an SD card if you intend to use the camera (which we do).

Here is a video of us demonstrating the basic interaction between the ADK and the phone:

All code is here on Github.

1. Debugging: Google provides a lovely screen on the phone to show which sensors are doing what (their shield comes tricked out with everything from a temperature sensor to a joystick), but we are having trouble figuring out how to view the console on the phone to test whether we are able to access the camera.
2. Accessing the camera: Using ITP alum/prof Shawn Van Every’s Pro Android Media book, we have been able to get the camera on the Android working independently of the Google ADK. We are having trouble getting the Views to change, such that the phone switches to the camera view upon a button press.

This is now much easier thanks to the Arduino team! Following the steps on this site, you can now use Processing instead of Eclipse to talk back and forth with your Android device. Please note the correct OS for Android as the build will fail if you are running on a  less recent version of Android.

Other things to be wary of:

Make sure you are running the most recent version of Processing and that you have closed any other instances of it running.

If you’ve recently tried this and run into an XML related error, it is because Processing got rid of its XMLElement and now made it a class simply called XML. Thanks to Mike Uzzi and Tom Igoe, this has now been updated in the Arduino ADK file.

To fix this error XML error because it is now XML xml. Need to re-package Arduino ADK folder so that the (within the Arduino ADK –> Processing –> tools –> Arduino_ADK –> src) is up to date with Processing’s changes following this template. Make sure to keep the Processing template zipped as it is just a reference. Arduino_ADK should be the only project with files. The antiquated version looks like this:

The new version should look like this:


In you have to include import processing.core.xml (underneath private XML xml).

This entry was posted in ITP Semester 2, Wildlife Tracking. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *