| June 15, 2011 | ||
| 6:00 pm | to | 8:00 pm |
Mobile meets Physical
Tom Igoe and Shawn Van Every will go over using mobile devices to interface with and control hardware.
Class Notes:
The ADK
Google has created the Android Open Accessory Development Kit it allows USB accessories to interact with Android applications.
Note: The accessory is the USB host
Their official download is available here: https://dl-ssl.google.com/android/adk/adk_release_0512.zip
The kit’s hardware design is based on Arduino and includes arduino libraries that work with the hardware reference
It also includes an Eclipse project for an Android application: DemoKit
Processing for Android Setup
Processing a creative coding environment has support for Android. Since Processing is much easier to get started with than Eclipse/Android SDK, we thought it would be the tool to demo this with and the Arduino folks are building some nice stuff
Download Processing: http://processing.org/
Download the Android SDK: http://developer.android.com/sdk/index.html
About Processing for Android: http://wiki.processing.org/w/Android
Note: We’ll need the Android API revision 10.
In order to work with the Arduino, we’ll need two other items which are on the thumb drive we are passing around.
1: Specifically in the “Processing/tools” directory we’ll need the folder it contains to be placed into Processing’s sketchbook, “tools” folder.
2: We’ll also need, from the Processing/libraries directory the entire ArduinoAdkUsb folder should be copied into the user’s Processing sketch folder in a folder called “libraries”
Arduino Setup
Version 1 beta is required:
http://files.arduino.cc/downloads/arduino-1.0-beta1.dmg OSX
http://files.arduino.cc/downloads/arduino-1.0-beta1.zip Win
http://files.arduino.cc/downloads/arduino-1.0-beta1.tgz linux 32 bit
http://files.arduino.cc/downloads/arduino-1.0-beta1-64.tgz linux 64 bit
Install the two libraries from the thumb drive’s “Arduino” directory into the Arduino “libraries” folder which should be in your Arduino sketchbook folder.
Processing for Android Hello World
PFont myFont;
char theKey = '0';
void setup() {
// No size, use full screen
// height, width variables are available
// Force specific orientation
//orientation(PORTRAIT);
orientation(LANDSCAPE);
String thisFont = PFont.list()[0];
myFont = createFont(thisFont, 128);
textFont(myFont, 128);
}
void draw() {
background(255);
fill(#2389F6);
text(theKey, width/2, height/2);
}
void keyPressed() {
theKey = key;
}
More advanced, with Permissions
import android.content.Context;
import android.os.Vibrator;
PFont myFont;
char theKey = '0';
Vibrator vibrator;
long[] pattern = {200,800,200,800};
void setup() {
// No size, use full screen
// height, width variables are available
// Force specific orientation
//orientation(PORTRAIT);
orientation(LANDSCAPE);
String thisFont = PFont.list()[0];
myFont = createFont(thisFont, 128);
textFont(myFont, 128);
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
}
void draw() {
background(255);
fill(#2389F6);
text(theKey, width/2, height/2);
}
void keyPressed() {
theKey = key;
vibrator.vibrate(pattern, 1);
}
It requires the “VIBRATE” permission. You can add that via the Processing, “Android” menu and choosing the “Sketch Permissions” item.
Now to start with Arduino

I’ll be there
I’ll be there helping Shawn with the Arduino end of things. We’ll have a preview of the new Arduino Mega ADK for Android to work with.
I’ll be there
I’ll be there
Sounds interesting–I’ll be there
I’ll be there
I’ll be there.
I’ll be there
I’ll be there
I’ll be there
I’ll be there
I’ll be there
I’ll be there
I’ll be there
This will be a fun one. I’ll be there
I’ll be there
I’ll be there
I’ll be there
I’ll be there
I’ll be there
I will not be able to make it. Have fun.
[...] I’ve fallen very behind in posting about the sessions I’ve been attending at ITP Camp, but the one I attended last night has so much exciting potential, it’s skipping the queue of posts of previous sessions. The session description and info can be found here. [...]
[...] App development, Cinder. And Jitter from Gabe Barcia-Colombo. I am looking forward to working in Processing for Android with Arduino. Kate Hartman’s wearable session was great too. This year I gave a session on [...]