I recently got my hands on a new RIoTboard and wanted to start developing on it as soon as I could. The first thing I did was check if any guides existed, and sure enough there was this guide from element14. However, it uses Windows and I am primarily a Linux guy. What the following guide will do is do the same process for Linux users, as well as introduce the primary application that I will be programming android apps in: Kivy, which uses Python as its primary language.
Getting Your RIoTBoard Running
What you need:
in your power supply and HDMI Cable you should see this after a few seconds:
This means your RIoTboard is up and running! Just plug in a mouse and drag the lock symbol somewhere to open your Android Menu.
Creating Apps using Java
The first goal of this post is to simply replicate the Windows guide for Linux Users. It should be noted that I am running Ubuntu 12.04. This guide should work with all versions of Ubuntu though.
First you need to install Java. Go to a terminal and type:
sudo apt-get install default-jdk
While that is installing, download the Android Development Kit (ADK). Resist the big blue button and instead click on "Download for Other Platforms"
You're going to need to find whether you are running 32 bit or 64 bit linux. Open a terminal and type:
The output of which will be either:
x86_64 (This is 64 bit)
i686 = (This is 32 bit)
(Note: I am running 64 bit linux. If anyone is running 32 bit linux and part of this guide is wrong, please let me know!)
Select the ADT Bundle for your version (Linux XX-bit) and download it. When it is finished downloading, unpack it to wherever on your computer you want it. It should unpack as something like "adt-bundle-linux-x86_64-20131030".
Open the folder, then go to the "eclipse" folder. Double click the "eclipse" file. If it prompts you, tell it to execute. You should get a nice ADT Splash Screen.
Next it will prompt you to choose a workspace. Give it whatever folder you prefer.
You are almost done! Just follow the rest of his part II guide, with these minor differences:
- In part II in the SDK Manager go to Tools -> Options and click the "Force https..." checkbox. Only do this if you can't get it to behave (it needs to show all the different Android versions)
- I had to unplug/plug the RioTboard a few times to get it to show up in the devices list, but it eventually did! Try changing which USB port you plug it in too. Also, mine came up with the full name:
Awesome! You are now doing Android Development on Linux! If your particular distro has any other issues, please let me know and I will update them here.
Running Python Programs on your Android -- Using Kivy!
Kivy is a pretty cool development platform for Android that uses the super popular (and super easy) Python programming language. Since I am a python guy myself, this is how I would like to develop. One of the great things about Kivy is that it runs in pretty much every environment that Python runs -- this means that the develop / test / package cycle can be significantly reduced because Kivy can run right in your Linux (or Windows) box.
The first thing you need to do is install kivy and its associated packages. This is explained here, but to sum it up:
sudo add-apt-repository ppa:kivy-team/kivy
sudo apt-get update
sudo apt-get install python-kivy python-kivy-examples
sudo apt-get install pkg-config python-setuptools python-pygame python-opengl \
python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev \
build-essential libgl1-mesa-dev libgles2-mesa-dev cython
If everything works, you should be able to run their pong example right out of the box. This is one of the things that makes Kivy so cool: it is truly cross platform, making general development extremely easy.
Your computer should have installed examples at "/usr/share/kivy-examples", or you can download them at the bottom of the page. The project we are using is in tutorials/pong. Just run main.py (Open terminal and type "python main.py"). You should get a pong game
Play with the paddles to make sure everything is running correctly. The next step is to compile the python code into an android app and run it on our phones. We will leave that for part II of this installment. Stay tuned!
kivy-examples.zip 4.9 MB