Skip to content

Commit

Permalink
Update Android md files
Browse files Browse the repository at this point in the history
  • Loading branch information
icarpis committed Dec 25, 2017
1 parent 9ac6086 commit db3b37a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
11 changes: 5 additions & 6 deletions doc/android/Android.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Build Intel® RealSense™ SDK 2.0 for Android OS
This document describes how to build the [Intel® RealSense™ SDK 2.0](https://github.com/IntelRealSense/librealsense) including headless tools and examples for Android devices.

> **Disclaimer:** Intel® RealSense™ SDK 2.0 for Android devices is an experimental capability and is **not** officially supported by Intel RealSense group at this point. Pay attention that your target Android device should be [rooted](https://en.wikipedia.org/wiki/Rooting_(Android)) in order to run RealSense SDK tools/examples and to access the RealSense cameras.
* **Doing this tutorial is on your own risk.**
> **Disclaimer:** Building Intel® RealSense™ SDK 2.0 for Android devices is intended to run on [rooted](https://en.wikipedia.org/wiki/Rooting_(Android)) devices due to Android USB permissions policy.
## Ingredients
Before jumping to the instructions section please ensure you have all the required accessories.
1. Linux host machine with Ubuntu 16.04.
1. Linux host machine with [Ubuntu 16.04](https://www.ubuntu.com/download/desktop).
2. [Rooted Android target device](https://en.wikipedia.org/wiki/Rooting_(Android)).
3. [USB OTG](https://en.wikipedia.org/wiki/USB_On-The-Go) cable.
3. [USB3 OTG](https://en.wikipedia.org/wiki/USB_On-The-Go) cable.

## Android Application & SDK Headless Samples
* [Build an Android application for RealSense SDK](./AndroidJavaApp.md)
## Instructions of how to build SDK Headless Samples & Android Application
* [Build RealSense SDK headless tools and examples](./AndroidNativeSamples.md)
* [Build an Android application for RealSense SDK](./AndroidJavaApp.md)
33 changes: 16 additions & 17 deletions doc/android/AndroidJavaApp.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
# Build an Android Application for RealSense SDK
This document describes how to build an Android application to stream depth with RealSense cameras.
This document describes how to build an Android application to stream Depth data with RealSense cameras.

> **Disclaimer:** Intel® RealSense™ SDK 2.0 for Android devices is an experimental capability and is **not** officially supported by Intel RealSense group at this point. Pay attention that your target Android device should be [rooted](https://en.wikipedia.org/wiki/Rooting_(Android)) in order to run RealSense SDK tools/examples and to access the RealSense cameras.
* **Doing this tutorial is on your own risk.**
> Read about Android support [here](./Android.md).
## Instructions
1. [Root](https://www.wikihow.tech/Root-Android-Phones) your Android device.
2. Install [Android Studio](https://developer.android.com/studio/install.html) IDE for Linux.

3. Open Android Studio, click on "configure" and choose "SDK Manager".
3. Open Android Studio, click on `configure` and choose `SDK Manager`.
```shell
./android-studio/bin/studio.sh
```
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/AndroidStudio1.png" /></p>

4. [Install NDK](https://developer.android.com/ndk/guides/index.html#download-ndk) for Android Studio. Do the section "Download the NDK and Tools" and skip to the third step ("3. Check the boxes next to LLDB, CMake...").
4. [Install NDK](https://developer.android.com/ndk/guides/index.html#download-ndk) for Android Studio. Do the section "Download the NDK and Tools" and skip to the third step (3. Check the boxes next to LLDB, CMake...).

5. Click on "Start a new Android Studio project".
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.
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.
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/AndroidStudio2.png" /></p>

7. Choose "API 19: Android 4.4 (KitKat)" in the first listbox and click on the "Next button".
7. Choose `API 19: Android 4.4 (KitKat)` in the first listbox and click on the `Next` button.
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/AndroidStudio3.png" /></p>

8. Choose "Empty Activity" and click on the "Next" button.
8. Choose `Empty Activity` and click on the `Next` button.
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/AndroidStudio4.png" /></p>

9. Ensure that the Activity Name and the Layout Name are containing "MainActivity" and "activity_main" respectively and click on "Next".
9. Ensure that the `Activity Name` and the `Layout Name` are containing `MainActivity` and `activity_main` respectively and click on the `Next` button.
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/AndroidStudio5.png" /></p>

10. Choose "C++11" at the "C++ Standard" list box, tick the checkbox "Exception Support" and click on the "Next" button.
10. Choose `C++11` at the `C++ Standard` list box, tick the checkbox `Exception Support` and click on the `Next` button.
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/AndroidStudio6.png" /></p>

11. Clone the latest [RealSense&trade; SDK 2.0](https://github.com/IntelRealSense/librealsense/releases) to your host machine and place the librealsense folder in the Android application folder under "./realsense_app/app/src/main/cpp/".
11. Clone the latest [RealSense&trade; SDK 2.0](https://github.com/IntelRealSense/librealsense/releases) to your host machine and place the librealsense folder in the Android application folder under `./realsense_app/app/src/main/cpp/`.

12. Replace the content of "MainActivity", "native-lib.cpp", "activity_main.xml" and "CMakeLists.txt" with ["MainActivity"](MainActivity.java_), ["native-lib.cpp"](./native-lib.cpp_), ["activity_main.xml"](./activity_main.xml_) and ["CMakeLists.txt"](./CMakeLists.txt_) respectively.
12. Replace the content of `MainActivity`, `native-lib.cpp`, `activity_main.xml` and `CMakeLists.txt` with [MainActivity](MainActivity.java_), [native-lib.cpp](./native-lib.cpp_), [activity_main.xml](./activity_main.xml_) and [CMakeLists.txt](./CMakeLists.txt_) respectively.
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/AndroidStudio7.png" /></p>

13. 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.
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.
<p align="center"><img width=50% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/cellphoneScreen.png" /></p>

14. Install [Terminal Emulator](https://en.wikipedia.org/wiki/Terminal_emulator) on your Android device from Google Play Store.
Expand All @@ -52,8 +51,8 @@ chmod 0777 /dev/bus/usb/<Bus number>/<Dev Number>
```
<p align="center"><img width=50% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/TerminalEmulator.png" /></p>

17. Open the "realsense_app" application.
17. Open the `realsense_app` application.

## Expected Output
* Streaming Depth data
<p align="center"><img width=90% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/DepthApp.png" /></p>
* Streaming Depth data using rooted Android S4 device.
<p align="center"><img width=50% src="https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/android/DepthApp.png" /></p>
3 changes: 1 addition & 2 deletions doc/android/AndroidNativeSamples.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Build RealSense SDK Samples for Android OS
This document describes how to build the Intel® RealSense™ SDK 2.0 including headless tools and examples for Android devices.

> **Disclaimer:** Intel&reg; RealSense&trade; SDK 2.0 for Android devices is an experimental capability and is **not** officially supported by Intel RealSense group at this point. Pay attention that your target Android device should be [rooted](https://en.wikipedia.org/wiki/Rooting_(Android)) in order to run RealSense SDK tools/examples and to access the RealSense cameras.
* **Doing this tutorial is on your own risk.**
> Read about Android support [here](./Android.md).
## Instructions
1. [Root](https://www.wikihow.tech/Root-Android-Phones) your Android device.
Expand Down
2 changes: 1 addition & 1 deletion doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
* [D400 and External Devices](rs400/external_devices.md) - Notes on integrating RS400 with external devices
* [D400 Advanced Mode](rs400/rs400_advanced_mode.md) - Overview of the Advanced Mode APIs
* [D400 cameras with Raspberry Pi](./RaspberryPi3.md) - Example of low-end system without USB3 interface
* [D400 cameras on rooted Android device](./Android/Android.md) - Instructions of how to build the RealSense SDK for Android OS.
* [D400 cameras on **rooted** Android device](./Android/Android.md) - Instructions of how to build the RealSense SDK for Android OS.
* [Record and Playback](../src/media/readme.md) - SDK Record and Playback functionality using ROS-bag file format

0 comments on commit db3b37a

Please sign in to comment.