ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Create a new Ros Android application

asked 2015-06-25 10:28:59 -0500

mmore gravatar image

updated 2015-06-25 23:57:54 -0500

I've installed rosandroid ( ) and can run the sample applications/tutorials. Now I want to create a new Android Studio Project and develop my own app. I found this tutorial here, but it doesn't work.

I executed these commands:

roscd android_core
cp -a android_tutorial_pubsub my_package

and added include "my_package" to android_core/settings.gradle

But when i run this command:

./gradlew my_package:clean my_package:debug

I get the following Error:

    FAILURE: Build failed with an exception.

* Where:
Build file '/home/user/android_core/src/android_core/my_package/build.gradle' line: 18

* What went wrong:
A problem occurred evaluating project ':my_package'.
> Could not find method compile() for arguments [org.ros.rosjava_core:rosjava_tutorial_pubsub:[0.2,0.3)] on project ':my_package'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Can somebody help me or post another tuorial for creating a new Android Project?

edit retag flag offensive close merge delete



have you found a solution for this problem?

LeMan gravatar image LeMan  ( 2015-10-23 06:51:40 -0500 )edit

Not really. But you could copy "android_tutorial_pubsub" in your file explorer and rename it to something like "android_myrosandroidapp" and add 'include "android_myrosandroidapp"' to android_core/settings.gradle . After this you have to remove the unnecessary files manually in your IDE.

mmore gravatar image mmore  ( 2015-10-23 15:48:16 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-01-13 01:04:29 -0500

mmore gravatar image

Based on the article "Creating Android Packages" in the wiki I found a solution:

catkin_create_android_pkg android_foo android_core rosjava_core std_msgs
cd android_foo
catkin_create_android_project -t 10 -p bar
cd ../.. ; catkin_make

Finally add the following line to your file build.gradle:

dependencies {
    compile 'org.ros.android_core:android_10:[0.2,0.3)'
edit flag offensive delete link more

answered 2015-12-20 04:03:29 -0500

Zargol gravatar image

##Finally I made my own android APP


sudo apt-get install oracle-java7-installer
sudo aptitude install ia32-libs lib32ncurses5 lib32stdc++6

Download android-sdk-linux from link below and extract:

sudo chmod +x

install and run (see link below)

Now I have 4 folder (android-ndk-r10e, android-sdk-linux, roscpp_android, roscpp_android_ndk)

sudo gedit ~/.bashrc

add the lines in ~/.bashrc:

export PATH=${PATH}:/home/<username>/android-sdk-linux/tools
export PATH=${PATH}:/home/<username>/android-sdk-linux/platform-tools
export PATH=${PATH}:/home<username>/android-studio/bin
export ANDROID_HOME=/home/<username>/android-sdk-linux


download the sample app below:

  • folder jni , write your own c++ code
  • folder res, define your layout
  • folder src, write your java code

com_ros_sampleapp_sampleApp.h file in the jni folder and AndroidManifest.xml make connection between java (graphical part) and c++ (ros part)

#debug and install

ant debug

after connecting your mobile to your computer-> active USB debugging

ant debug install
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-06-25 10:28:59 -0500

Seen: 1,875 times

Last updated: Jan 13 '16