- français
- English
Installing Android Studio + SDK and ROSJava Environment:
Installing Android Studio + SDK and ROSJava Environment:
ROSJava is an opensource project in pure Java for inegrating ROS with Android Development Environment.
*All the instructions provided below have been tested on Ubuntu 12.04 LTS. They might change for other Linux distributions. For example, the same installation procedure will not work on Linux Mint. That would require building from the source (a method which the ROS website does not recommend).Installation in Ubuntu 12.04 is fairly easy due to the availability of precompiled debs (debian files)*
-
Android Studio and SDK
The new android development (hydro and beyond) is based on google's Android Gradle Plugin &
Android Studio which will be replacing the ADT & Eclipse. It is available for download on
Windows, Linux and MacOSX. The following steps cover the installation procedure in Linux Ubuntu:
-
Prerequisites:
You will need a Java development. There are two available kits; openjdk and Oracle Java
Development Kit. Android Studio will give you a warning on start up if you use
openjdk, but we just ignore it right now. Read below if you want more information
on which jdk to use.
To install openjdk:$ sudo apt-get install openjdk-6-jdk
Why we might need an Oracle JDK:
According to the ROS website:
“Android studio shows you a healthily fat warning when you start it that recommends you use oracle's jdk, or else it will be all doom and gloom. We haven't had major issues with the openjdk yet, although anecdotal evidence suggests that if you are short on memory the Oracle JDK is better.”
If you do want to install oracle's jdk on ubuntu:$ sudo add-apt-repository ppa:webupd8team/java -y $ sudo apt-get update $ sudo apt-get install oracle-java6-installer # Switch back to openjdk anytime with sudo update-alternatives --config java
-
Installation:
-
If you're using a 64 bit machine, the ia-32 libs have to be installed.
$ sudo apt-get install ia32-libs
-
Download android studio and untar it under /opt/android-studio (recommended). Add to your path. If you put the files anywhere other than /opt/android-studio you will have to tweak the following command to suit:
$ echo export PATH=\${PATH}:/opt/android-studio/sdk/tools:/opt/android-studio /sdk/platform-tools:/opt/android-studio/bin >> ~/.bashrc $ echo export ANDROID_HOME=/opt/android-studio/sdk >> ~/.bashrc
-
Open up the Android SDK Manager with the command:
$ android
-
In the SDK Manager make sure you have installed
Under Tools:
- Android SDK build tools 19.0.1
Android API 19 / 18 / 17 / 16 /15 / 13 / 10 / 7
(Unclick the TV addons from API 13)
-
SDK versions Android 2.3.3 (API 10), Android 3.2(API 13) and Android 4.2.2 (API 17). It's not a whim to install three different versions: we use API 10 for Gingerbread compatible libraries, API 13 for Honeycomb libraries (that cannot work on Gingerbread) and API 17 because is the latest at the time of this writing. You can open Android Studio with the command:
$ studio.sh
Now we are equipped with Android Studio and SDK and now we can start installing the ROS debian packages and libraries
-
-
Installing ROS & ROSJava Debians
-
Now we have a fully fuctional Android Studio integrated and SDK integrated with the ROSJava development environment. The next post shall cover integrating the ROS Sensors Driver with the smartphone, running the ROS master node on the laptop and reading the sensor values from the smartphone.