IOIO-OTG Beginners Guide


Introduction

This is the beginners guide for using the IOIO-OTG board in Android mode and is intended for users that have never written an Android app. The goal of this tutorial is to show how to write a simple app that communicates with the IOIO board. If you are interested in using the IOIO-OTG in PC mode, please refer to this wiki.

IOIO-OTG

The programming language used to write an Android app is Java. If you are not familiar with Java, this tutorial will only go over writing a simple Java app using the IOIO library. This tutorial will not cover how to write Java code nor will it cover how to use the rich features within your Android device, like GPS, accelerometer, touch screen, etc. Once you get to the point where you want to use the vast array of features on your Android, we suggest first looking at the technical resource section on developer.android.com. If you still can't find the examples you are looking for, simply browsing the web will result in a ton of information and examples that show you how to communicate with all of the great pieces of hardware within your Andriod device.

In general, the holy grail for developing Android apps is developer.android.com. There, you will find most of the information on Android development. For documentation/downloads specific to the IOIO and for more advanced discussions about the IOIO, see these links:

Gathering Your Hardware

Here are the pieces of hardware you will need to complete this tutorial:

  • Android enabled device using OS 1.5 or greater
  • IOIO-OTG board, with adapter cable
  • USB cable that is compatible with your Android device
  • 5-15V power supply with at least 1A of current. You will need to power the IOIO through the VIN and GND pins or there is an optional JST connector, which can be used with this adapter and wall wart power supply. More information at the end of the tutorial found here.

Installing the Development Environment

The Eclipse IDE (integrated development environment), the Android SDK (software development kit), and the JDK (Java development kit) are the primary pieces of software that you will need to install. The page developer.android.com has written thorough instructions on what exactly you will need to download. Please read the instructions carefully, they are found in the link below:

ATTENTION: You must use JDK v6 (not v5 or v7) for Android development.

If you have any problems, see the Troubleshooting section from developer.android.com.

When you reach Step 4 in the Android SDK tutorial, you will at least need to install the SDK components relevant to the Android device you will be working with. For example, if you have an Android phone, goto Settings > About Phone and scroll down to Android Version. You must install the SDK platform corresponding to the Android version of your device.

Import the HelloIOIO Example

Instead of creating a new project from scratch, we can import an existing IOIO project that has all of the files ready to go. If you need instruction on creating a new project, see the Hello World example on developer.android.com.

To import an existing project...

1) Download the latest 'Android Software and IOIO Application Firmware Image' zip file (App-IOIOxxxx, where xxxx is the software/library version number).

Note: If you are using an older IOIO board, make sure the version number of your IOIO library is less than or equal to the version number of your firmware. In other words, if you can't get the sample app to work with an older IOIO, use one of the older library versions or upgrade the firmware on your IOIO using the IOIO Manager and then use the latest download.

2) Unzip the downloaded package into a safe location where you want to keep your project files.

3) Next, open Eclipse, then goto File > Import, and select Existing Projects Into Workspace. Then hit Next.

 

4) Another window will pop up (as shown below). Select 'Select Root Directory' and navigate to the file you just unzipped and point to the HelloIOIO folder found in /applications/HelloIOIO. Be sure the check box is selected for your project. Now hit Finish.

  

 

5) You should now have HelloIOIO in your project explorer in Eclipse. Notice that there is a small red x next to the project name. This means there are build errors, so whenever you see this, you know something needs to be fixed. In this situation, we need to link the IOIO library to our project, as outlined in the next step.

 

6) Now we need to link the IOIO library and IOIO Bluetooth library to your project which will give you full access to the IOIO API. The IOIOLib and IOIOLibBT directories contains the libraries that allow you to communicate to the IOIO board.

Follow the exact same steps in 3 and 4 above, except use the IOIOLib file and then the IOIOLibBT instead of the HelloIOIO file.

After you added the library files into the workspace, select the HelloIOIO project, then on the top toolbar goto: Project > Properties. Then, select 'Android' in the list to the left. In the 'Library' section, click add, then add both the IOIOLib and IOIOLibBT libraries. You should see both of them with a green check mark as shown below (note: image doesn't show the IOIOLibBT, but it should be there if using Bluetooth).

Also, make sure the 'Project Build Target' is properly selected according to the specific Android OS you are using.

Note: If you ever need to change your build target (say you are using a device with a different Android OS), you can change it here.

7) The next thing you need to do is make sure your app has internet permissions. To do this, open the AndroidManifest.xml file located in the main project tree. Make sure you are in the permissions tab, then click Add > Usage Permissions, then make sure the 'Name' field is android.permission.INTERNET. See the picture below for reference:

After you have done this and saved your project, the projects explorer window should look something like this:

Notice the red x error flags are gone.

The project tree has many files. You really don't need to mess with the IOIOLib project tree so you can minimize that one. The file that contains the java code for the IOIO is in HelloIOIO > scr > ioio.examples.hello > MainActivity.java. Double click on the MainActivity.java file and you should see this:

Here you can start writing code and changing the HelloIOIO sketch. At this point you can keep reading or jump immediately to setting up your IOIO board and testing the app.

The MainActivity.java file contains the code that talks to the IOIO board. If you want to change the UI (user interface or graphics) of your app, the res > layout  > main.xml file is where you make the changes. The main.xml file in the HelloIOIO example uses an interface that looks like this:

For more information on XML layouts, see the hello world example on developer.android.com, then scroll down to the 'Upgrade the UI to XML Layout' section.

At this point you should be ready to write your own Android IOIO app. You can now keep reading or jump immediately to setting up your IOIO board and testing the app.

Troubleshooting Project Errors

Eclipse has the ability to compile your code in real time. When there is an error, you will see a red x somewhere in your project. This can mean many things. To figure out what the errors are, Eclipse has tab called 'Problems' that shows you what errors you are getting. This tab is usually found towards the bottom of the Eclipse window. Sometimes the error will tell you exactly what's wrong and sometimes the errors are more obscure.

If you are getting unknown errors in your project, please refer to the IOIO-OTG troubleshooting guide.

The Example IOIO Sketch

After you have imported the HelloIOIO file and linked the IOIOLib file, you are ready to start writing code. The example sketch displays a toggle button on the screen, which enables control of the on-board LED. This example shows a very simple usage of the IOIO and will give you an idea of what to expect when programming.

The code in the MainActivity.java file is shown below.

        package ioio.examples.hello;

import ioio.examples.hello.R;
import ioio.lib.api.DigitalOutput;
import ioio.lib.api.exception.ConnectionLostException;
import ioio.lib.util.AbstractIOIOActivity;
import android.os.Bundle;
import android.widget.ToggleButton;

/**
 * This is the main activity of the HelloIOIO example application.
 * 
 * It displays a toggle button on the screen, which enables control of the
 * on-board LED. This example shows a very simple usage of the IOIO, by using
 * the {@link AbstractIOIOActivity} class. For a more advanced use case, see the
 * HelloIOIOPower example.
 */
public class MainActivity extends AbstractIOIOActivity {
    private ToggleButton button_;

    /**
    * Called when the activity is first created. Here we normally initialize
    * our GUI.
    */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        button_ = (ToggleButton) findViewById(R.id.button);
    }

    /**
    * This is the thread on which all the IOIO activity happens. It will be run
    * every time the application is resumed and aborted when it is paused. The
    * method setup() will be called right after a connection with the IOIO has
    * been established (which might happen several times!). Then, loop() will
    * be called repetitively until the IOIO gets disconnected.
    */
    class IOIOThread extends AbstractIOIOActivity.IOIOThread {
        /** The on-board LED. */
        private DigitalOutput led_;

        /**
        * Called every time a connection with IOIO has been established.
        * Typically used to open pins.
        * 
        * @throws ConnectionLostException
        *             When IOIO connection is lost.
        * 
        * @see ioio.lib.util.AbstractIOIOActivity.IOIOThread#setup()
        */
        @Override
        protected void setup() throws ConnectionLostException {
            led_ = ioio_.openDigitalOutput(0, true);
        }

        /**
        * Called repetitively while the IOIO is connected.
        * 
        * @throws ConnectionLostException
        *             When IOIO connection is lost.
        * 
        * @see ioio.lib.util.AbstractIOIOActivity.IOIOThread#loop()
        */
        @Override
        protected void loop() throws ConnectionLostException {
            led_.write(!button_.isChecked());
            try {
                sleep(10);
            } catch (InterruptedException e) {
            }
        }
    }

    /**
    * A method to create our IOIO thread.
    * 
    * @see ioio.lib.util.AbstractIOIOActivity#createIOIOThread()
    */
    @Override
    protected AbstractIOIOActivity.IOIOThread createIOIOThread() {
        return new IOIOThread();
    }
}

In the code above, there are plenty of comments that explain what each line does. This app is a great starting point for making sure your development environment and the IOIO board is working correctly.

Eclipse is a very powerful tool and gives debugging information in real time. For instance, if you write code that doesn't make sense, Eclipse will show a red x next to the line in question and even give you suggestions as to how to change the line of code. Simply hover your mouse cursor over the line and you will see something like this:

Keep in mind, if you have errors, you will not be able to compile and run your code, you will need to fix any errors.

Also, the IOIOLib has thorough JavaDocs that can be generated and browsed via Eclipse. Goto Project > Generate Javadocs.

Here are some more resources to help you out with writing code:

Compiling, Loading, and Running the App on Your Android Device

If you change any part of the code, simply saving the project compiles the program and creates a new HelloIOIO.apk file. An apk file is a compressed Android Package file, similar to zip and jar. files, that is used to create an app on your Android device. This file can be found in the HelloIOIO project tree within the bin directory.

Here are the steps to get the example app working on an N1 Android phone running the 2.3.3 platform.

1. Enable USB debugging. Settings > Applications > Development > Enable USB Debugging

2. Install the apk file. The easiest way to get the apk file on your device is to plug the device into your computer. When prompted to install drivers, point to the driver located in Android (should be in Program Files for Windows users) > android-sdk > extras > google > usb_driver. Next, right click on the HelloIOIO project in the project explorer within Eclipse goto Run As > Android Application (or hitting the green play button on the top tool bar runs your application as well). Your apk file should now be installed on your android device. Unplug your android device from your computer, then move to the next step. More information on the Google USB driver is found here.

3. Prepare the IOIO board. The only thing you need to do for the HelloIOIO example is power the IOIO board. Keep in mind, the IOIO board will always need an external power supply between 5-15V. Single cell LiPos batteries will NOT work, you need a 5-15V input. You can connect the power supply to the VIN and GND pins (headers will need to be soldered in place) or to the JST connector. If using the JST connector, you might want this adapter cable.

4. With the IOIO powered, you can plug the USB cable into the IOIO and into your Android device. The Android device should show that USB debugging is connected in the notification bar, in addition, the Android should indicate it is charging. If you don't see either of these two notifications, try adjusting the 'chg' potentiometer next to the USB connector on the IOIO board. The potentiometer changes how much current is being used by the power supply to charge the phone. If there isn't enough, then the phone might not be detected by the IOIO.

5. Open the Hello IOIO app and toggle the button, you should see the yellow stat LED come on and off. Congratulations! You are now on your way to creating your very own IOIO apps!

Note: The best way to develop IOIO apps is to have your phone plugged into your computer while writing and editing the code. Then running the application (as shown in step 2) will erase the old app and load the newly edited app onto your phone. You can now unplug your phone from your computer, then plug it into the IOIO to test what you have done. 

Example Projects

We have a blog post that shows or has links to many well documented example projects, with source code. It is a great resource, so please check it out (and be sure to read through the text for links)! Also, check out this collection of IOIO based projects.

Updating the IOIO Firmware

The IOIO firmware is code that sits on the PIC microncontroller located on the IOIO board. Sometimes new changes will be pushed out and you might have an board with older firmware. There is a very simple way to update the IOIO firmware. 

Comments 72 comments

  • Guys, I have seriously just wasted an entire day trying to solve build issues with the HelloIOIO project and the IOIOLib library. I kept getting the red cross next to the SRC folder in IOIOLib. ECLIPSE was failing to compile the *.java files in “ioio.lib.impl” and “ioio.lib.util”…EVENTUALLY, after countless installs/reinstalls/rebuilds/cleans/SDK and ADT version updates, the problem was found to be the JRE version installed on the PC. You cannot use the IOIOLib library with either JRE version 1.5 or JRE 1.7!! It HAS to be JRE 1.6! This is assuming a setup of ECLIPSE 3.7.1; ADT v15 (required according to IOIOwiki for latest apk) and Android 4.0.3. (I tried with every Android API version and none worked unless I used JRE 1.6… Just thought I would post this here to save anyone else the anguish which I have just experienced…PEACE

    • I also had problems while running 64-bit eclipse and both 64-bit and 32-bit JDE 1.6. I finally removed any 64-bit eclipse or Java and everything finally worked. So in my debugging, I unearthed that ADK is not compatible with 64-bit JDK.

    • THANX! ghjtng I wish i sow your message one weak ago! =D

  • Are there different types of JST connectors? I’ve looked at suppliers on eBay and what they call JST connectors all seem to have the male notch on the connector with the male pins, which is the opposite of the connector the IOIO OTG uses, i.e. its female notch is in the connector with the male pins. A few even appear to have dual notches instead of single. I’m confused as to what I should be looking for if I want to buy the proper JST mating connector for this board from a source other than Sparkfun (no offense, SF).

  • I successfully imported the examples in the eclipse and linked the IOIO libraries as well. But the error in IOIOLIBAccessory in the following line usbManager_ = UsbManager.getInstance(wrapper); is not getting resolved.

    I know it is related to USB but i don’t know how to resolve it.

    BTW: I’m using MAC OS X, Java 1.6, Android 4.2.2.

  • Is it possible to program this to have a output to a touch screen? Like if you wanted to view files from your Android.

  • Is it possible to program this to have a output to a touch screen? Like to view files?

  • Is it possible to program this to have a output screen? Like to view files that is shared over Bluetooth.

  • Is there a more up-to-date version of this tutorial?

    I have tried to follow the instructions using both App-IOIO330.zip and App-IOIO400.zip, but must make guesses as to some of the steps since it looks like this tutorial was written for an earlier version of Eclipse that the current one.

    I can’t even get HelloIOIO to compile, Eclipse begins by complaining that it can’t find the gen folder, and it goes downhill from there.

    If I modify the import step and use the Android option “Existing Android Code into Workspace” I can get as far as HelloIOIO not compiling because R.java never gets generated. I’m not sure why I would get this error, or what to do about it, since I have not changed anything from the downloaded code, and I would think it should compile and run, and Eclipse doesn’t show me any other errors in the various res folder assets.

    Thanks for any pointers, Brent

  • I’m not exactly a beginner but this has certainly kicked my butt. I think I can build my own IOIO easier than I can figure out what’s wrong with this software. Takes more than just version 1.6 of the JRE I think. Tried that I think. Since none of the libraries will compile for me, I am having trouble seeing how the app can ever compile. I’ve looked though most of this. I don’t even feel like complaining anymore. Just do something, anything else.

    Any suggestions where maybe a more useful example might be?

    Did some more reading again today, to the bottom of the Troubleshooting Guide. What a difference a day makes. For anyone else having a problem. This was my fix:

    You MUST uncheck the Copy Projects into Workspace box when you import. I’ve pretty much ignored that field for 3 years. Then things work as they say they should. That is, you will still have to download the old JRE then tell it to Fix Project Setup if you are using an up to date JRE and set the OS target up higher if you didn’t download all of the older ones. But it now compiles.

    Hope this helps.

    It’s been a couple more frustrating days compiling but not working. The errors from the logcat looked like this:

    06-05 16:22:23.954: V/IOIOImpl(17583): Waiting for underlying connection 06-05 16:22:23.954: I/IncomingState(17583): IOIO Connection established. Hardware ID: SPRK0020 Bootloader ID: IOIO0400 Firmware ID: IOIO0330 06-05 16:22:23.954: V/IOIOImpl(17583): Querying for required interface ID 06-05 16:22:23.962: E/IOIOImpl(17583): Required interface ID is not supported 06-05 16:22:23.962: E/IOIOBaseApplicationHelper(17583): Incompatible IOIO firmware 06-05 16:22:23.962: E/IOIOBaseApplicationHelper(17583): ioio.lib.api.exception.IncompatibilityException: IOIO firmware does not support required firmware: IOIO0004

    So it appears to me that the v40 stuff isn’t going to work. I load up the v33 stuff. Now I have reached the point where it tells me it can’t find the MainActivity class. I fool around with it and eventually it quits telling me now JNA 3.5. (more BS) will not run on my device. Jeesh!

    I’m back to building my own. This has been the biggest time waster I’ve seen for a while. Even if it does work today, looks like it might quit tomorrow or the next day and require more time wasting.

    Final call for suggestions before I throw this board in the trash can and move on.

    Thanks.

  • I was wondering if anyone could help me with a driver install issue. I have followed the guide and can get everything working (even on an emulator) but my computer can’t recognize the IOIO driver file, so I can’t do any input/output with the board. It shows up in device manager as IOIO but has a warning symbol over it, and when I go to the add hardware wizard it says the file cannot be found (when I point straight to it).

    I’m using the IOIO OTG, Windows 7 x64 and version 4.1.2 Jellybean (emulator/phone). I’ve wasted a lot of hours trying to figure this out, and I’ve asked multiple people for help. Nothing seems to work! (doesn’t work on Windows 8 x32 either)I would really appreciate if someone had a fix for this issue… please help!

  • I have the older IOIO (I don’t know if this will make a difference) and the components are getting very hot, i am supply 9 volts at around an amp and everything is working fine. I know that it should get a little hot but what it is doing does not seem normal. Any idea what the problem is?

    • Check if you accidentally changed powerlines + and -.

  • Has anyone used Processing as the IDE instead of the Eclipse?

  • I have a sony xperia neo and I wonder if this tutorial is applicable using my phone.


    Medical Assistant Job Description

  • Do you still have a page of example projects? I guess you used to link to a blog post


    Example Projects

    We have a blog post that shows or has links to many well documented example projects, with source code. It is a great resource, so please check it out( and be sure to read through the text for links)!

    but the link now takes you back to this same page, which doesn’t have any example projects.

    Thanks,

  • Can it works with my mediacom 736i tablet?

  • When USB Debugging Mode is active, the stat LED stays lit. When I run it normally, the Hello IOIO application runs as expected. HTC EVO 4G.

    • Your android might be running OpenAccessory protocol (which means you do not need to enable USB debugging). I think open accessory runs on android OS 3.1+.

  • Problem red exclamation points next to HelloIOIO,IOIOLib and IOIOLibBT

    I have been following this tutorial and have run into a snag. I have JDK1.6.0_25 and jre6 and the Android SDKs installed. I downloaded App-IOIO0324 and have imported the project and libraries into Eclipse as instructed. I have both Eclipse 32 and 64 bit versions on my system.

    I am running Windows 7 Pro 64bit OS. The tutorial explains how to associate the imported libraries with the HelloIOIO project but when I get to the >Properties for HelloIOIO>Android project build target window, I see the IOIOlib and IOIOLibBT libraries with green checks in the Library pane and IOIOLibAccessory with a red X. If I click add at this point I get a box titled “Project Selector” which has nothing available to select.

    Window>Preferences>Java>Compiler is set to Compiler Compliance level 1.6 and use default compliance settings.

    Android Manifest seems to be preset to the correct permissions in App-IOIO0324.

    Eclipse complains: Unable to resolve target ‘android-3’

    I have made sure that my path statement is set to the correct bin directory for Java 6.

    I had Java 7 installed but took it off of the system to troubleshoot this.

    Help.

    • Okay, here’s the solution to my problem:

      I’m sure that there are other people who have very little experience with eclipse, java and android so hopefully this will get the problems resolved. When I imported the latest version of helloioio, eclipse automatically install references to associations to ioiolib, ioiolibbt and ioiolibAccessory. So the compiler starts complaining about the libraries being missing for all of the imported projects (the red exclamation points).

      If you follow the above tutorial where it says to go to HelloIOIO>Properties>Android>Library you will already see the library projects which you have imported with green checkmarks next to them and if you click the add button there, will be no options to add any libraries. This is where I got stuck.

      First go to the Problems pane and delete all of the errors and warnings. Eclipse finds all of these errors as you add the additional packages and doesn’t clear them automatically once they are no longer valid. But if you look at the import statements in src>ioio.examples.hello>MainActivity.java there will be no errors after you have imported the libraries.

      Next right click on HelloIOIO>Android Tools>Fix Project Properties.

      Delete any more errors or warnings that might show up.

      Reboot Eclipse.(Don’t know why but the project didn’t load correctly until I did this)

      Now the code should boot the Android without any errors

      Glad I can get on with it now.

  • It’s not SFE’s fault really… Java is a joke and Android development poses a challenge with only one remedy - don’t develop in Android!

  • I’ve installed android4 javasdk7. This code can not import eclipse. Publish the new version. I’m not buying the product for the unused code.

    • You need to installed the JDK 6 and not JDK 7. On the developer.android.com site, under System Requirements, it has more information and links about installing JDK 6. :)

  • Got my IOIO board a few hours back .. ran the hello ioio apk .. the stat light glows .. so I guess we can say that the HTC Incredible S (Droid 2) works with the IOIO.

    I’ve got a problem though : I used a cheap chinese cell phone charger to power on the board and then connected my cell phone to the board. My LCD touch response shuts down when this happens. Is this due to some grounding issue / harmonics because of the charger or something else ?

  • okay ive been trying to get this so work for hours now, and every time i import into eclipse i get the same error before i even do anything. which is that the IOIOlib project has no ‘gen’ folder. ive tried every single download and the same problem persists with each one. I see on the image in the tutorial that it is supposed to have a gen folder. any way of getting around this??? ANY help from anybody would be HUGELY appreciated! thanks

    • First download the v3.11 lib if you have recently purchased a board. Then import IOIOlib, then IOIOBT, then your project. After each import right click and make sure you have your JDK compiler settings set to 1.6.

      Also, v3.6.2 of Eclipse seems to not have these issues.

      • ok thankyou, i am pretty new to ioio programming and electronics in general. I have a tamiya lunchbox RC car which i wish to control via the ioio. Ive got a servo with red, black & orange wires coming from it, an ESC which has a connection from the main car battery, green/blue wires coming from it to drive the motor, another connector with red/black wires, and another coming out of it with white/red and black wires (to take input from the reciever (which i do not have) and a switch.

        What is the best way to link all of this up with the ioio without frying the shit out of it? ive got a separate 9v battery to power the ioio board. Any help would again be hugely appreciated as i am a bit of a n00b! :) cheers

        EDIT: if anyone would be able to talk me through some of this over skype etc. I would be eternally grateful!!!

        • In terms of control, you will need to use one pin to control the servo signal line and one pin to control the ESC signal line. The protocol to use is PWM to control the motors. More info on how to use PWM can be found on the IOIO wiki. Hope that helps!

          • yeah i thought as much. how about the power lines on each component, can i wire them all to get power straight from the car battery? rather than take them all through the ioio.

            I noticed the ioio was getting pretty hot when simply powered from the 9v to the VIN/gnd. Any better way of doing this?

            Thanks for your help :)

            • You might want to post on our forum, you’ll probably get lots of detailed design help there.

              You should be fine powering the board with 9V on Vin. I am not sure of the specs of your components, but servos generally can be powered at 5V. Your ESC should be powered by the RC car’s battery, the extra black and red wires are probably a power bus out of the ESC, and the white wire is probably the motor control line. Please don’t quote me on this, I don’t have your setup in front of me. Also, it is generally a good idea to have your motors and servos on a separate power system than your digital parts or at least make sure you decouple the power lines well with good caps.

            • who decided to design the charge potentiometer with a shitty plastic head? after two attempts at turning it the thread is completely destroyed, gotta fork out £40 for a new one now… ffs!!!! any way to fix this? bodge jobs welcome!

              • Sorry about that, those things are somewhat delicate.

                You can short across the terminals and feed 5V directly into USBVCC (be sure to look at the schematic/eagle files or find the right pins with a DMM). Then your android will want to take a full charge though and will drain a small battery pretty fast.

              • Ah only just saw your last reply, thanks for your help again! i guess ill just have to wait till the new one arrives until i can test it out.

                Cheers

  • I have made it through all of the steps, but when I plug my phone into the IOIO it doesn’t show as connected. It does show that it is charging, and adjusting the charge potentiometer doesn’t seem to matter. Question: is there a way to see what version of the board that I have?

  • Guys I’d been trying to compile my project and I can’t I keep getting this error Description Resource Location Path Type The container ‘Library Projects’ references non existing library ‘***\bin\ioiolib.jar’ IOIOLibBT Build path Build Path Problem

    And that happens aswell with HelloIOIO Project when I try to build it, thanks for the help

    • Right click on each one of you project files (including IOIOlib and IOIOBTlib) and goto Properties -> Java Compiler and make sure your JDK compliance level is set to 1.6. Then restart Eclipse.

  • Am an experienced Android and Java developer who has used eclipse for several years now, for two days I’ve been trying to get this work. Can you please update the tutorial with step by step photos of where exactly you download the files to? Thanks.

  • I need help. After importing HelloIOIO and IOIOLib, instead of an x next to them, I have an exclamation point “Project has no default.properties file! Edit the project properties to set one.” Then going into the properties>android, gives an error message “The currently displayed page contains invalid values” and does not show IOIOLib as a library to add. Thoughts? I’m probably missing something obvious

    • Sorry for the trouble. The tutorial has been update and I have added a troubleshooting section. Hope that helps!

    • You are probably missing one of the packages in the SDK Manager. Goto ‘Window’ -> ‘Android SDK Manager’ and make sure you have everything installed for you specific Android OS version.

  • i need some help.

    I cant do it run om my system: - ubuntu 11.04 - eclipse (motodev studio for android) with SDK15 and JRE1.6

    So many errors and a red exclamation at helloioio and ioiolib projects.

    After many rebuilds, reinstall, i am lost.

    Thank You for any help

  • I’ve been trying to get the HelloIOIO and IOIOLib to build, and am stuck at an entry in the local.properties of the IOIOLib package.

    The only non, comment line in that file is

    sdk.dir=/Users/ytai/android-sdk-mac_x86

    which is of course not valid. Where does one change that?

    BTW - I am using the 3.11 version of IOIOLib and examples.

    Thanks

  • Hi, followed all the steps but I’m having problems with the HelloIOIO example. Here is a screenshot of the problem http://imageshack.us/photo/my-images/834/screenshotat20120107232.png/ What should I do?

  • this link http://codaset.com/ytai/ioio/wiki is dead, what is the updated site to access?

  • I’m stuck at Step 2. in the ‘Compiling, Loading, and Running the App on Your Android Device’ section. When the ‘choose device’ screen comes up, my phone shows up as ‘offline’ so it won’t let me choose it. I’ve tried rebooting my phone, rebooting my computer, turning off debugging mode on my phone, then turning it back on. Still offline. I’ve also tried running ‘adb kill-server’ then ‘adb start-server’, but this doesn’t get my phone online either. :( Any ideas? Oh, I have a Motorola ATRIX 4G, Windows XP Pro (32-bit), and the latest version of Eclipse ‘Classic’.

  • also working with: huawei ideos - u8150 - android 2.2 / level 8 - e.g. with App-IOIO0302/HelloIOIO.apk

  • Works on T-Mobile Huwaei Comet just fine. On errors not in the quickstart guide above just switch Java Build to “1.6” and SDK level to “8” in the Manifest.xml file.

  • Hello,
    I’ve been trying to link the IOIOLib to the HelloIOIO file in eclipse , but the download for the IOIOLib does not contain an res file(it does in these pictures). Does someone know how to get it or how to change that error?

  • I got the HelloIOIO working on my DroidX in no time, but the app locks up after the screen goes dark or if you switch to another app and then return. I must Force Close to get it going again.

  • Brilliant tutorial, thanks so much. Just got myself a Samsung Galaxy S2 and planning on controlling a remote test rig from it using GSM over 500miles away. Should get interesting!

  • Is there any way to communicate with an Android device via the USB port without the user having to put it in developer mode?

    • AFAIK, Android 2.x may only make use of the USB port in accessory mode (that is, it may not act as a host). It also has no API in the de-facto SDK for manipulating USB communications. Android 3.1 introduced a USB host mode and USB communications, but AFAIK the Android 3.x releases have only been for use on tablets.
      A backported package for Android 2.3.4 added the ability to manipulate USB communications with host devices other than adb. The IOIO board has a firmware update available to take advantage of this, and it eliminates the need to have the device in debug mode.
      Relevant Links:
      IOIO update: http://codaset.com/ytai/ioio/wiki/IOIO-Over-OpenAccessory-Beta
      Google Open Accessory Development Kit: http://developer.android.com/guide/topics/usb/adk.html
      (hopefully that was all correct XD )

  • Wow…30 min and I got it talking to my rooted HTC evo 4g…way coool. Not to make it do something usefull…

  • Will this device also work with Android tablets?

  • I just got the HelloIOIO app working on the Motorola Atrix!
    Eclipse: I’m going to be working with Eclipse, not because I’m familiar with it – I can get around in it okay, but I’m no expert with it – but because that’s what half the world is using for Java development nowadays. I see it as good experience.
    Power supply: For prototyping, I’m okay with a wall wart for now, but I’ll be checking out that battery power thread on Google once I get a project together.

  • If you can not resolve R.layout.main
    instead of using:
    import android.R;
    use:
    import ioio.examples.hello.R;
    shift + ctrl + o is also good
    you could also remove R.java and project->rebuild
    now it works well ;-)

  • I just followed up the tutorial and tried on a Sony Xperia X8 (Android 2.1) and I cannot get the sample app working. Tried the 2 connection modes with the phone (“charge” and “data”). The sample turnOn/turnOff would not work. Will try again this weekend. How are you guys debugging the communication? How do I know the phone is actually reaching the board?
    -greetz, Gerard.

  • Just got this up and running on my WiFi-only Samsung galaxy tab. Hardly any trouble at all since I already had Eclipse set up to develop android apps.
    However, the board would not connect to my HTC Droid Incredible. When I plug in the board to the DINC, it continuously tells me “USB Debugging” and the charge light goes on, then it goes off after 2 seconds and repeats until I unplug the board. Has anyone else got this running on their DINC?
    All in all, I’m happy with the results because I really only need it for the Tab.

  • Thankyou for the tutorial!
    Got this all up and running on an EVO 4G in a couple hours.
    The example works as intended on the first run, but it always force quits on resume (for me)…Still have to figure out why…

  • Suggestion: in the section where we read:
    “After you added the IOIOlib file into the workspace, on the top toolbar goto: Project > Properties. Then, select ‘Android’ in the list to the left. In the ‘Library’ section, click add, then add the IOIOlib library. You should see the IOIOlib with a green check mark as shown below."
    Change the wording like so:
    "After you added the IOIOlib file into the workspace, select the HelloIOIO project, then on the top toolbar goto: Project > Properties. Then, select ‘Android’ in the list to the left. In the ‘Library’ section, click add, then add the IOIOlib library. You should see the IOIOlib with a green check mark as shown below."
    I made the mistake of assuming you meant to do this on the IOIOLib project, which had me scratching my head for a bit.

  • What battery power options are suitable for this? I tried using my LilyPad AAA battery source (http://www.sparkfun.com/products/8466), which my voltage meter showed giving 5V, and while it got the red light on the IOIO going I got no reaction from my G2 phone. Twiddling the chg dial didn’t help.
    I don’t want to be tied to an A/C outlet, but I don’t know if the fault is with the power source I used or if there’s something wrong in my set up.
    EDIT: Some info on battery power here: https://groups.google.com/group/ioio-users/browse_thread/thread/f7e669151e6f4e99

  • Thanks for the tutorial. Are there any examples that do not require the use of Eclipse, examples that build an IOIO project from the command line? Every Android project in Eclipse gives “Mismatched VM version: JVM_GetThreadStateValues not found”.
    Suggestions on alternative approaches very welcome.
    EDIT: Just learned that current versions of Eclipse allow for exporting Ant files for projects. This allowed me to build the code using ant instead of going through Eclipse. Very handy. File -> Export -> General -> Ant buildfiles

  • “In general, the holy grail for developing Andoird…"
    Android, not Andoird…!
    Cool tutorial though!