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
- Root your Android device.
- Install Android Studio IDE for Linux.
- Open Android Studio.
./android-studio/bin/studio.sh

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.

- Choose
API 19: Android 4.4 (KitKat)
in the first listbox and click on theNext
button.

- Choose
Empty Activity
and click on theNext
button.

- Ensure that the
Activity Name
and theLayout Name
are containingMainActivity
andactivity_main
respectively and click on theNext
button.

- Choose
C++11
at theC++ Standard
list box, tick the checkboxException Support
and click on theNext
button.

- 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/
. - Replace the content of
MainActivity
,native-lib.cpp
,activity_main.xml
andCMakeLists.txt
with MainActivity, native-lib.cpp, activity_main.xml and CMakeLists.txt respectively.

- Connect the Android device to the host machine. Click on
Run
and chooseRun 'app'
. Choose your Android device and click on theOK
button. At the end of this process a new application supposed to appear at the Android device.

- Install Terminal Emulator on your Android device from Google Play Store.
- Use the USB OTG cable to connect the RealSense camera to your Android device.
- 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>

- Open the
realsense_app
application.
Expected Output
Streaming Depth data using rooted Samsung Galaxy S4 device.

Updated about 2 years ago