Pairing IOIO Bluetooth

Using Bluetooth with IOIO

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.

IOIO Bluetooth

You should see the IOIO in the list. Click on it to get started pairing.

 

 

 

Pairing IOIO Bluetooth

 

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

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.

Android Studio Start Up Screen HelloIOIO

Then direct Android Studio to the AS-HelloIOIO-master folder and click ok.

Android Studio HelloIOIO Project

 

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.

HelloIOIO Android Studio on your phone

Prior to connecting to the IOIO the button will be disabled.

HelloIOIO Android Studio Screenshot

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)

Connect Phone to the IOIO to test HelloIOIO

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.

HelloIOIO connected Android Studio

 

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 Android Phone into Developer Mode

Android Studio Developing on your phone

Android Studio Developing on your phone

First you need to put your into developer mode.

Click on Settings
Getting Android Phone into Developer Mode

 

Go to About Phone
Getting Developer Mode on Android Phone

Click on Build number 7 times
Android Studio Android Phone into Developer Mode

 

Go back into the settings menu and click on developer options, then check USB Debugging.

USB Debugging Android Studio

 

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.
Developing in Android Studio on your phone

 

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.

Developing in Android Studio on your phone

Running Android Studio Programs on your phone

 

And that’s Android Studio Developing on your phone.

Android Studio Start Up Screen HelloIOIO

Compiling your first Program in Android Studio

Start a new project:

New Project in Android Studio

Name your New Project in Android Studio or Keep the Default

Name your project in android studio

 

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.

Target Device on Android Studio

Pick Blank Activity

Add a Blank Activity to your project

 

Leave customization of the activity with the defaults.

Customize your App android Studio

Don’t stress about rendering errors if you see them.

Android Studio will then build your project

 

Android Studio will then build your project

Click the Green Triangle to run the program or hit Shift F-10

Android Studio will then build your project

It may take a while to compile the code. Then Click OK to launch the emulator

Launch the Emulator Android Studio

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.

Launch the Emulator Android Studio

Here is how it should look:First Android Studio App

Congratulations you have completed Compiling your first Program in Android Studio.

Downloading Android Studio

Installing Android Studio for IOIO

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:
https://developer.android.com/sdk/index.html

Downloading Android Studio

You will need Java Development Kit 7 installed(6 will work for versions less than 5.0).

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

Downloading Java Development Kit

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.Installing Android Studio First Step

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.

Installing Android Studio assign directories

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.Downloading Components for Android Studio to work

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.

Andriod Studio Start Up Screen

You have now successfully installed android studio. Using it and Getting the IOIO to work with it are the next step.