Skip to content

Software Installation

Jordan McConnell edited this page Feb 11, 2014 · 87 revisions

This tutorial will guide you through the installation process in order to create Android applications with Processing that interact with your IOIO-OTG and other electronic hardware..

There are a handful of programs you will need to install including the Android SDK, the Processing development environment, and the Java Development Kit. We have created bundles for Windows and Mac that include these programs to make this installation process as convenient as possible. There might be newer versions available then what is included in our download but it is suggested to use the versions we include. The reason for this is that the Android SDK (software development kit) changes often and dependencies can be severed on other pieces of software (i.e. Processing).

We will provide installation instructions for both Windows (XP/7/8) and Mac OSX.

This process is known to work on Android phones running versions between 2.3.3 to 4.2.1. Here's a list of verified devices.

The entire process can take up to an hour and a half, however it all depends on your download/processor speed.

With out further adieu, let's get started.

Step 1 - Download the Software Bundle

These downloads are rather large, so while you're waiting, feel free to check out the manual included the kit. You can use this time to download applications with QR codes and play with the circuits. Later once you have this software you're downloading installed, you can begin tinkering with the code.

Once the download is complete, unzip the bundle to any folder on your computer.

Step 2 - Installing the Java Development Kit

Windows: The bundle included the JDK installer (jdk-7u45-windows-i586.exe). Install the JDK with the included exe.

Mac: The Mac OS includes the JDK by default so it does not need to be installed and a JDK installer was not included in the Mac bundle. If you want, you can check this by typing javac -version into your terminal window.

Step 3 - Preparing the Android SDK

Extract the Android SDK zip from the bundle. Place the Android folder wherever you want but make sure you remember it's location.

For Windows, I placed my Android folder in the Program Files directory. Later, when we install Android mode in Processing, we will have to point to the android-sdk folder that resides within the Android folder.

Step 4 - Setting up the Processing Development Environment

Extract the Processing application from the zip file in the bundle. Place it where you please. Once again, remember where you placed it.

Start the program with the processing.exe file within the directory for Windows or the processing.dmg file for Mac.

With Processing running, you should see a button in the top right that says 'Java'.

Standard java mode

Click the button and it will open a drop down menu. Select the 'add mode' option and it will open the mode manager.

Mode Manager

Under the mode manager, find the android mode like above and click the 'Install' button. This will install Processing's android development mode.

Once installed, click the Java button again and switch to Android mode, you might be asked to find the Android SDK location path. When prompted, point to this location within your Android SDK directory (specifically the android-sdk folder inside the Android folder). Here is what my path looks like:

C:\Program Files (x86)\Android\android-sdk

Android mode

Your Processing window should now be in Android mode and you should see the Android label in the top right like above.

Step 5 - Installing the SIKIO libraries and examples

Locate the Processing sketchbook folder named Processing. It should be found in one of these locations [you can also go to File -> Preferences in processing and see your sketchbook location]:

Windows: C:[path to your home directories]\My Documents\Processing

Mac: /Users/Username/Documents/Processing

If the folder doesn't exist, create it. Within this Processing sketchbook folder, create a folder called 'libraries' if it does not exist.

Open the SIKIO-master.zip that you just downloaded and extract the 'sikio' and 'apwidgets' folders into the libraries folder. This will allow Processing to use code that can interact with the IOIO-OTG hardware.

Here is what my libraries directory looks like afterward (ioio folder is actually called sikio now):

libs

Before being able to use the libraries, you have to restart Processing.

After restarting, go to Sketch -> Import Library and you should see the SIKIO library, apwidgets, and any others that are in your libraries folder.

Importing

Step 6 - Preparing your Android Device

USB Debugging

Check that your USB debugging is turned on for your Android device.

On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.

On Android 4.0 and newer, it's in Settings > Developer options. Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options and turn on USB debugging.

Third Party Application Installation

Also make sure your phone is set to allow installation of non-market apps. Go to Settings > Applications and check the box for 'Unknown Sources' which allows third party apps to be installed.

Step 7 - Running Your First IOIO Project

Open Processing and go to File -> Examples...

IOIO examples

This will open the menu above on the right. Under 'Contributed Libraries -> ioio', double click the first example (SIKIO_C0_quickstart).

Run on Device

Now connect your phone via USB to the computer and click the play button in the top left to 'Run On Device'. Processing will build the code and attempt to load the apk file to your android. Here is what it looks like when it works.

works

You should also now see the application pop up on your Android. It will just look like a black screen until your IOIO is connected. Connect the IOIO to your phone with the USB cable and it should start running. You will see a blinking rectangle on the screen and the IOIO's status LED will start blinking. Here is a screenshot of what you should see on your Android device:

App running

Congrats, you've completed the software install and have the quickstart code working.

To start learning more about how the code works, head over the the explanation of the quickstart code.

Troubleshooting

Android Device Driver

Plug your Android device into your computer via a micro USB cable.

The first time you do this, as with any new USB device, you should see a notifications about driver installation when you plug your Android into your computer. (Sometimes more than one driver comes up. For example, my N1 shows up as two devices, 'Nexus One' and 'USB mass storage'. Most of the drivers will automatically install, like the mass storage device, however your Android device drivers might not be found (usually enumerates as the name of your Android).

Go to your Device Manager via the control panel and see if your computer is recognizing your device. If not, use the Device Manager to point it to the driver found here:

[Your Android SDK install location]\Android\android-sdk\extras\google\usb_driver

For example, mine was found here:

C:\Program Files\Android\android-sdk\extras\google\usb_driver

Here is what my device manager looks like after the driver has installed on my N1:

device_manager

Make sure the Android has enumerated and is shown as an Android ADB interface.

Note: On some newer Androids, you must connect your Android as a Camera (PTP) and not a Media device (MTP). This option is found in your notifications bar.

If the default google driver fails. Search the internet with your phone make and model and look for the ADB drivers. An example search could be Samsung Nexus S ADB USB drivers. Once you find a suitable driver, install it and open up the Device Manager to verify if your phone is now recognized.

Processing finds the wrong SDK location

If Processing is not finding the SDK, or is finding a previously installed SDK (that may have the wrong properties), check this forum on the Processing site.

Permissions

Also, in Processing, go to Android -> Sketch Permissions and make sure the INTERNET permission is checked (needed to talk to the IOIO).

If All Else Fails

If the app fails to run properly when the IOIO is connected, try restarting the application.

Additionally, Processing has an Android wiki page that has a lot of helpful hints.

Clone this wiki locally