Using Bluetooth with IOIO
The IOIO’s seamless bluetooth integration is one of it’s most amazing features. It makes Bluetooth with IOIO development a lot quicker as your android device can remain connected via USB for debugging, and you don’t have to spend time connecting and disconnecting the cable, and turning off and on USB Debugging.
As far as bluetooth devices that work with IOIO, there is a list of devices that work, but it is somewhat out of date. You can find the list here. I can tell you that the Insignia device sold at Best Buy doesn’t work. I use the Soundbot SB340 which is reasonably cheap but gets the job done. It works with both my Galaxy S5 and my Galaxy Nexus.
To pair with the IOIO, Plug the Bluetooth into the red usb cable and power up the IOIO.
Go into your phones bluetooth settings and scan for new devices.
You should see the IOIO in the list. Click on it to get started pairing.
The pairing request will ask for a pin. The pin should be “4545”.
Now go run a program from Android Studio. If you’ve included the IOIOLibBT library, your ioio should connect to your phone automatically.
HelloIOIO Android Studio
I hope that this post becomes unnecessary before to long, but at this point the HelloIOIO app which is usually the first IOIO app that is compiled by someone playing with the Google IOIO OTG board for the first time, doesn’t compile in Android Studio. The IOIO community is running Eclipse as it was the previous Android IDE, and support of Android Studio hasn’t happened as of this posting. I took it upon myself to try to work out the kinks to run HelloIOIO in Android Studio.
To get started download the source code for the Android Studio Version of HelloIOIO from github here. If the download doesn’t work correctly go to this page and click download zip in the lower right.
This should download a zip file of the HelloIOIO Android Studio source code. Unzip/extract this file to your AndroidStudioProjects folder. Then open Android Studio and Open an existing Android Studio Project.
Then direct Android Studio to the AS-HelloIOIO-master folder and click ok.
Android Studio will then load the HelloIOIO project. You can then run it by clicking the run button or by hitting shift F10. Then if you haven’t already, hook your phone up(you must have unlocked developer mode and have android debugging enabled), and choose your phone as the target.
Prior to connecting to the IOIO the button will be disabled.
At this point, you can disconnect your usb from your phone and connect it to the IOIO. You may or may not have to disable debugging on your phone to get it to connect to the IOIO.(The IOIO will need to be powered seperately from the phone connection 5v-15v)
Your phone should demonstrate that it is charging when you connect it. If not, use a tiny screw driver to rotate the screw all the way to the right to get it to increase the current through the usb connection. Once connected it will show this screen.
The button should be enabled now, and clicking it will turn on the pin 0 LED in the center of the IOIO board. Don’t forget to put your phone back in Debug mode. You may want to seriously consider Bluetooth connection to avoid all the hassle of disconnecting and reconnecting, and the ability to Debug on the fly.
Android Studio Developing on your phone
First you need to put your into developer mode.
Click on Settings
Go to About Phone
Click on Build number 7 times
Go back into the settings menu and click on developer options, then check USB Debugging.
You may need to install the Driver for your phone. These drivers can be obtained here for Nexus Devices.
Or here to download the manufacture specific drivers.
Open Android Studio to your program. This pop-up should show, check the box so that it doesn’t ever have to ask you this ever again.
Then go and run your program(shift + F10) and you will be able to pick your phone as the target to run your program on.
And that’s Android Studio Developing on your phone.
Start a new project:
Name your New Project in Android Studio or Keep the Default
Unless you have a specific reason for using a newer version of android I would go with an older version that will work on more devices.
Pick Blank Activity
Leave customization of the activity with the defaults.
Don’t stress about rendering errors if you see them.
Click the Green Triangle to run the program or hit Shift F-10
It may take a while to compile the code. Then Click OK to launch the emulator
The Emulator then takes a very long time to load, much of which just says the android logo. It will make you run through a few new device setup screens but will ultimately load your program.
Here is how it should look:
Congratulations you have completed Compiling your first Program in Android Studio.
Android Studio for IOIO
Android Studio is now the official IDE for android application development. Unfortunately the IOIO community is still deeply entrenched in Eclipse, but do plan to make the switch. It is possible to get IOIO working with Android Studio it’s just a little tricky at the time of this writing. Start with downloading Android Studio at:
You will need Java Development Kit 7 installed(6 will work for versions less than 5.0).
Find your OS version, and download the appropriate file. If you can’t decide between x86 and x64 for windows the x86 should work on either. You will get better performance on heavy processing stuff with x64 if you have a newer PC with lots of RAM.
These two downloads will take some time, so start them both downloading early or you’ll be doing a lot of waiting.
I’m not going to walk you through the install process as this is straight forward. You may want to pay attention to the install directories as they can come in handy if Android Studio can’t find it.
Android Studio will want to know what you want installed. Initially I would install everything so you don’t have problems.
Accept the license agreements.
Pay attention to where it installs, and ensure you have enough disk space. If you don’t have enough space clean some up, I recommend windirstat to help you identify where it is being hogged.
The install will complete and run. The first thing android studio will do when it runs is download the Latest Android SDK, SDK Tools and APIs.
After that is downloaded it will show a log of everything it installed and ask you to click finish. It will then take you to the main start screen for android studio.
You have now successfully installed android studio. Using it and Getting the IOIO to work with it are the next step.