IOIOLib is a collection of libraries, for Android and for the PC, which enable your application to control the IOIO board. The libraries expose a set of Java interfaces, covering the various features of the board. When you build your application, IOIOLib gets packaged into your target
.apk file, so that your application is self-contained and does not require any further installation of dependent components. Now it is time to explain which libraries exist and what is the purpose of each one.
IOIOLibPC library (whose Eclipse project files are under
IOIOLib/target/pc) is the library you would use to interface IOIO from a PC. The
IOIOLibAndroid library (whose Eclipse project files are under
IOIOLib/target/android) is the library you would use to interface IOIO from an Android device. Two additional libraries,
IOIOLibAccessory are complementary to
IOIOLibAndroid and add Bluetooth and Android Open Accessory functionality as possible connections to the IOIO, respectively. The reason why they are separate is that the
IOIOLibAndroid library would work on any version of Android (as early as V1.5), while Bluetooth has been introduced in Android V2.x and Open Accessory is only available on select Android 2.3.4 or later devices. If you simply link any of those libraries (or both) to your application, your IOIO connection will automatically be established over whichever available channel, provided that your application is based on the Android utility classes (more on that later).
If you are not familiar with Android application development and/or have not yet setup your development environment, the IOIO Beginner's Guide page may provide useful information.
A good set of Java tutorials is available here.
The entire IOIOLib public API has standard Javadoc documentation, which is intended to be comprehensive and be used as reference while coding. In this User Guide, we try to cover usage of the library from a common-use-cases approach rather than be 100% formal.
The latest version IOIOLib can be downloaded from the Downloads page. It is a part of the "Software" zip. This zip also includes some sample applications.
We're only going to cover usage with Eclipse here, with the assumption that users not using Eclipse for Android application development probably know what they're doing anyway :)
IOIOLibto somewhere where you normally want to keep your projects.
android.permission.INTERNETpermission. This can set by opening the
AndroidManifest.xmlfile found at your project's root, going to the Permissions tab > Add... > Uses Permission > Select
IOIOLib includes two main parts:
The libraries are organized in several Java packages.
ioio.lib.apipackage contains the IOIOLib Core API for controlling the IOIO. This is the package your application will be using. It is identical between the Android libraries and the PC libraries, so that your app can be easy to port from PC to Android or vice-versa and there is no need to learn two different interfaces. The sub-package, the
ioio.lib.api.exceptionpackage contains some exceptions thrown by the IOIO API.
ioio.lib.implpackage contains the implementation of these interfaces and is not intended to be used directly.
ioio.lib.utilpackage contains the IOIOLib Application Framework, which will make your life a little easier when writing IOIO applications. Under this package, platform-specific packages are contained, in the respective libraries.
ioio.lib.util.androidcontains utilities specific to Android, which simplify the process of creating applications using the IOIO. Likewise,
ioio.lib.util.pccontains utilities which help creating various kinds of Java applications for the PC.
Last edited by ytai,