This document describes how to build an Android application to stream Depth data with RealSense cameras.
Read about Android support here.
-
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).
-
Click on
Start a new Android Studio project
. -
Change the Application Name and the Company Domain to
realsense_app
andexample.com
respectively, tick the checkboxInclude C++ support
and click on theNext
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 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.
- Streaming Depth data using rooted Samsung Galaxy S4 device.