henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 +0000 | [diff] [blame] | 1 | This directory contains an example Android client for http://apprtc.appspot.com |
| 2 | |
| 3 | Prerequisites: |
| 4 | - Make sure gclient is checking out tools necessary to target Android: your |
| 5 | .gclient file should contain a line like: |
| 6 | target_os = ['android', 'unix'] |
| 7 | Make sure to re-run gclient sync after adding this to download the tools. |
| 8 | - Env vars need to be set up to target Android; easiest way to do this is to run |
| 9 | (from the libjingle trunk directory): |
| 10 | . ./build/android/envsetup.sh |
| 11 | Note that this clobbers any previously-set $GYP_DEFINES so it must be done |
| 12 | before the next item. |
| 13 | - Set up webrtc-related GYP variables: |
| 14 | export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 $GYP_DEFINES" |
| 15 | export JAVA_HOME=</path/to/JDK> |
| 16 | export PATH=$JAVA_HOME/bin:$PATH |
| 17 | To cause WEBRTC_LOGGING to emit to Android's logcat, add enable_tracing=1 to |
| 18 | the $GYP_DEFINES above. |
| 19 | - When targeting both desktop & android, make sure to use a different output_dir |
| 20 | value in $GYP_GENERATOR_FLAGS or you'll likely end up with mismatched ARM & |
| 21 | x86 output artifacts. If you use an output_dir other than out/ make sure to |
| 22 | modify the command-lines below appropriately. |
| 23 | - Finally, run "gclient runhooks" to generate Android-targeting .ninja files. |
| 24 | |
| 25 | Example of building & using the app: |
| 26 | |
| 27 | cd <path/to/libjingle>/trunk |
| 28 | ninja -C out/Debug AppRTCDemo |
| 29 | adb install -r out/Debug/AppRTCDemo-debug.apk |
| 30 | |
| 31 | In desktop chrome, navigate to http://apprtc.appspot.com and note the r=<NNN> room |
| 32 | this redirects to. Launch AppRTC on the device and enter the same <NNN> into |
| 33 | the dialog box. |
| 34 | |
| 35 | Alternatively, replace the <NNN> from the desktop chrome into the following |
| 36 | command: |
| 37 | adb shell am start -a android.intent.action.VIEW -d '"https://apprtc.appspot.com/?r=<NNN>"' |
| 38 | This should result in the app launching on Android and connecting to the apprtc |
| 39 | page displayed in the desktop browser. |
| 40 | |
| 41 | Yet another way to is to send the apprtc room URL to the Android device (e.g. using |
| 42 | https://chrome.google.com/webstore/detail/google-chrome-to-phone-ex/oadboiipflhobonjjffjbfekfjcgkhco) |
| 43 | and choose to open the URL with the AppRTCDemo app. |