Note: This tutorial assumes that you have completed the previous tutorials: Pairing with Androids. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Create an Android App
Description: How to create an android app for robot-android pairing.Keywords: pairing, android, app
Tutorial Level: ADVANCED
Overview
This tutorial goes through the steps needed to build an android app for robot-android pairing. If you're not using an existing robot app to pair with, make sure you've read through the previous tutorial - Create a Robot App.
Installation
There are two ways to get and install the sources depending on whether you want to work in a fused ros-studio environment with all the sources, or you just want to create a new app on its own.
Ros Environment
This lets you download all the source stacks together and manage the compile easily with catkin.
Follow the android installation instructions.
- Make sure you use the android_apps rosinstaller.
Compile with catkin_make
Add your own gradle stack and subproject parallel to the others in ~/android/src.
Use the convenient catkin_create scripts.
Note that you can still import the stacks individually into Android Studio once you've done this initial build.
Android Studio Environment
With this method, you'll just create a new project in android studio and promptly start coding. All dependencies come from our maven repository and no ros environment is needed.
Follow this tutorial.
Code Structure
The android app must be a derivative of the RosAppActivity. For a very simple example to get you started, refer to the sources for Listener. This pairs with the rocon app Talker.