OLD | NEW |
1 This directory contains an example Android client for https://apprtc.appspot.com | 1 This directory contains an example Android client for https://apprtc.appspot.com |
2 | 2 |
3 Prerequisites: | 3 Prerequisites: |
4 - "Getting the code" on http://www.webrtc.org/native-code/android | 4 - "Getting the code" on http://www.webrtc.org/native-code/android |
5 - Set up webrtc-related GYP variables: | 5 - Set up webrtc-related GYP variables: |
6 export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_jav
a=1 | 6 export GYP_DEFINES="OS=android $GYP_DEFINES" |
7 OS=android $GYP_DEFINES" | |
8 To cause WEBRTC_LOGGING to emit to Android's logcat, add enable_tracing=1 to | |
9 the $GYP_DEFINES above. | |
10 - When targeting both desktop & android, make sure to use a different output_dir | 7 - When targeting both desktop & android, make sure to use a different output_dir |
11 value in $GYP_GENERATOR_FLAGS - for example | 8 value in $GYP_GENERATOR_FLAGS - for example |
12 export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_android" | 9 export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_android" |
13 or you'll likely end up with mismatched ARM & x86 output artifacts. | 10 or you'll likely end up with mismatched ARM & x86 output artifacts. |
14 If you use an output_dir other than out/ make sure to modify the command-lines | 11 If you use an output_dir other than out/ make sure to modify the command-lines |
15 below appropriately. | 12 below appropriately. |
16 - Finally, run "gclient runhooks" to generate Android-targeting .ninja files. | 13 - Finally, run "gclient runhooks" to generate Android-targeting .ninja files. |
17 | 14 |
18 Example of building & using the app: | 15 Example of building & using the app: |
19 | 16 |
20 cd <path/to/webrtc>/src | 17 cd <path/to/webrtc>/src |
21 ninja -C out/Debug AppRTCDemo | 18 ninja -C out/Debug AppRTCDemo |
22 adb install -r out/Debug/apks/AppRTCDemo.apk | 19 adb install -r out/Debug/apks/AppRTCDemo.apk |
23 | 20 |
24 In desktop chrome, navigate to https://apprtc.appspot.com and note the r=<NNN> r
oom | 21 In desktop chrome, navigate to https://apprtc.appspot.com and note the r=<NNN> r
oom |
25 this redirects to or navigate directly to https://apprtc.appspot.com/r/<NNN> wit
h | 22 this redirects to or navigate directly to https://apprtc.appspot.com/r/<NNN> wit
h |
26 your own room number. Launch AppRTC on the device and add same <NNN> into the ro
om name list. | 23 your own room number. Launch AppRTC on the device and add same <NNN> into the ro
om name list. |
27 | 24 |
28 You can also run application from a command line to connect to the first room in
a list: | 25 You can also run application from a command line to connect to the first room in
a list: |
29 adb shell am start -n org.appspot.apprtc/.ConnectActivity -a android.intent.acti
on.VIEW | 26 adb shell am start -n org.appspot.apprtc/.ConnectActivity -a android.intent.acti
on.VIEW |
30 This should result in the app launching on Android and connecting to the 3-dot-a
pprtc | 27 This should result in the app launching on Android and connecting to the 3-dot-a
pprtc |
31 page displayed in the desktop browser. | 28 page displayed in the desktop browser. |
32 To run loopback test execute following command: | 29 To run loopback test execute following command: |
33 adb shell am start -n org.appspot.apprtc/.ConnectActivity -a android.intent.acti
on.VIEW --ez "org.appspot.apprtc.LOOPBACK" true | 30 adb shell am start -n org.appspot.apprtc/.ConnectActivity -a android.intent.acti
on.VIEW --ez "org.appspot.apprtc.LOOPBACK" true |
34 | 31 |
OLD | NEW |