Install the Android SDK
I uninstalling the Android SDK and started over from scratch. Only this time I used the instructions found here:
http://wiki.processing.org/w/Android
on how to install the Android SDK. Note that the installation of the SDK takes a long time to complete so be sure to have something to do to keep yourself occupied while the install runs its course.
At the conclusion of this process, I had an Android SDK with the following packages installed:
- Tools:
- Android SDK Tools
- Android SDK Platform-tools
- Android SDK Build-tools
- Android 4.2.2 (API 17)
- Documentation for Android SDK
- SDK Platform
- Samples for SDK
- ARM EABI v7a System Image
- Google APIs
- Sources for Android SDK
- Android 2.3.3 (API 10) SDK Platform
- Extras: Android Support Library
- Extras: Google USB Driver
I went back to Processing and again tried to run a sketch in Emulator mode. Success! But be forewarned – the emulator is slow to get going. The first time I bailed as I was still getting the "Waiting for device to become available" message. It turns out I was just not being patient enough. The second time the emulator window finally showed up and after waiting some more, my sketch started running in the emulator.
Running the Sketch on my Nexus 4
Now it was time to try and run my sketch on my Nexus 4(Sketch ->Run on device). The first thing I did was go into my tablet’s settings and set the Developer Options -> USB Debugging to ‘checked’. I plugged my phone into my laptop and in Processing hit the Run button. Note that Processing defaults to running your app on the attached device. After going through the compilation stage I was once again seeing my old friend: "Waiting for device to become available". Now what? I was patient but realized that my patience was not going to pay off when the message "Lost connection with device while launching. Try again." showed up.
One step in the troubleshooting process was to make sure that the AndroidManifest.xml file for my sketch contained the following line: "android:debuggable=”true”" in the application section – it did.
Going back through documentation I saw that there was one thing I had neglected to do.
Install Device Drivers for my Nesux 4
The reason Processing couldn’t talk to my tablet was that I’m using Windows and if you are on the Windows OS you need to download and install USB drivers from your tablet’s manufacturer that can then be used by the Android SDK (ADB). I found the information on this part of the process here:
http://developer.android.com/tools/extras/oem-usb.html#Drivers
To install the Android USB driver on Windows 7/8 for the first time:
- Connect your Android-powered device to your computer's USB port.
- Right-click on Computer from your desktop or Windows Explorer, and select Manage.
- Select Devices in the left pane.
- Locate and expand Other device in the right pane.
- Right-click the device name (such as Nexus S) and select Update Driver Software. This will launch the Hardware Update Wizard.
- Select Browse my computer for driver software and click Next.
- Click Browse and locate the USB driver folder. (The Google USB Driver is located in
<sdk>\extras\google\usb_driver\.) - Click Next to install the driver.
After that, I run the processing again and Success! Processing connected to my tablet, downloaded the sketch, and the next thing I know I’m finger painting.