Rosanswers logo

I find it difficult to setup the libraries to use rosjava from an android application. the information available at wiki.ros.org refers to a bunch of pages on rosjava an related stuff, but they seem to be out-of-date, with many broken links or inaccurate descriptions.

For android development I use a windows computer with android-studio. So I would like to setup the libraries on this system too, intended for android development only, and provided that I use the predefined ros message types.

I would appreciate it a lot if anyone who has recently set up the rosjava in android-studio could give us some help and accurate descriptions on how to proceed to get the rosjava api accessible from an android app in android-studio.

thank you in advance

Originally posted by al on ROS Answers with karma: 18 on 2016-08-16

Post score: 0


1 Answer 1


Rosanswers logo

I recently build it for Ubuntu 14.04 and summarized the steps. In case you do not want to use Ubuntu 14.04 you will probably have to build most of the packages named in the following by yourself:

  1. Download and install the latest Android Studio from Google. Make sure to install the required SDK Build Tools and adjust the environment variables according to: http://wiki.ros.org/android/Android%20Studio/Download
  2. Download and install ros-indigo according to: http://wiki.ros.org/indigo/Installation/Ubuntu.
  3. Download and build the core sources of rosjava following the steps described at: http://wiki.ros.org/rosjava/Tutorials/indigo/Source%20Installation (Steps 3.2 and 3.3 can be omitted).
  4. Download and build the core android libraries and import them to Android Studio (there's an example app available) according to: http://wiki.ros.org/android/Tutorials/indigo/Installation%20-%20ROS%20Development%20Environment
  5. Start developing new ros-android apps.

If you want to stick with Windows or in general want to skip the source installation of rosjava it is probably the most suitable and easiest way to use the dependencies from the maven repositories in your *.gradle build file in Android Studio:

repositories { maven { url 'https://github.com/me/myjava_mvn_repo/raw/master' } }

Originally posted by SebTuT with karma: 36 on 2016-08-28

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by gvdhoorn on 2016-08-29:
+1 to the "add the dependencies from the Maven repositories to your gradle build file": that is a really 'light-weight' way to write rosjava programs on Windows, and requires almost nothing of the ROS infrastructure to be present on the development machine.

Comment by al on 2016-08-31:
Thank you for your comments and links! I opted for setting up the android-studio in windows by using the maven repository. I managed to create a simple rosjava android app from scratch. I am preparing a detailed tutorial that I will post here, so that beginners can face the typical issues.

Comment by gvdhoorn on 2016-08-31:
@al: if you feel @SebTuT answered your question, could you please mark the question as answered by ticking the checkmark to the left of the answer? Thanks.

Comment by al on 2016-09-01:
this links show some details of what I did: https://github.com/irvs/ros_tms/wiki/how-to-configure-rosjava-apps-with-gradle


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.