Build an Android application for Intel RealSense SDK

This document describes how to build an Android application to stream Depth data with RealSense cameras.

Read about Android support here.

Instructions

  1. Root your Android device.
  2. Install Android Studio IDE for Linux.
  3. Open Android Studio.
./android-studio/bin/studio.sh
777

Click on configure and choose SDK Manager. Install LLDB, CMake and NDK for Android Studio. Go to section "Download the NDK and Tools" and start with the second step (2. Click the SDK Tools tab).
5. Click on Start a new Android Studio project.
6. Change the Application Name and the Company Domain to realsense_app and example.com respectively, tick the checkbox Include C++ support and click on the Next button.

900
  1. Choose API 19: Android 4.4 (KitKat) in the first listbox and click on the Next button.
900
  1. Choose Empty Activity and click on the Next button.
900
  1. Ensure that the Activity Name and the Layout Name are containing MainActivity and activity_main respectively and click on the Next button.
900
  1. Choose C++11 at the C++ Standard list box, tick the checkbox Exception Support and click on the Next button.
900
  1. Clone the latest Intel RealSense SDK 2.0 to your host machine and place the librealsense folder in the Android application folder under ./realsense_app/app/src/main/cpp/.
  2. Replace the content of MainActivity, native-lib.cpp, activity_main.xml and CMakeLists.txt with MainActivity, native-lib.cpp, activity_main.xml and CMakeLists.txt respectively.
1855
  1. Connect the Android device to the host machine. Click on Run and choose Run 'app'. Choose your Android device and click on the OK button. At the end of this process a new application supposed to appear at the Android device.
899
  1. Install Terminal Emulator on your Android device from Google Play Store.
  2. Use the USB OTG cable to connect the RealSense camera to your Android device.
  3. Open the Terminal Emulator application and type below lines in order to move to Super User mode and change the USB permissions.
su
lsusb
chmod 0777 /dev/bus/usb/<Bus number>/<Dev Number>
899
  1. Open the realsense_app application.

Expected Output

Streaming Depth data using rooted Samsung Galaxy S4 device.

1599