webrtc/talk/examples/android
fischman@webrtc.org 32001ef124 PeerConnection shutdown-time fixes
- TCPPort::~TCPPort() was leaking incoming_ sockets; now they are deleted.
- PeerConnection::RemoveStream() now removes streams even if the
  PeerConnection::IsClosed().  Previously such streams would never get removed.
- Gave MediaStreamTrackInterface a virtual destructor to ensure deletes on base
  pointers are dispatched virtually.
- VideoTrack.dispose() delegates to super.dispose() (instead of leaking)
- PeerConnection.dispose() now removes streams before disposing of them.
- MediaStream.dispose() now removes tracks before disposing of them.
- VideoCapturer.dispose() only unowned VideoCapturers (mirroring C++ API)
- AppRTCDemo.disconnectAndExit() now correctly .dispose()s its
  VideoSource and PeerConnectionFactory.
- CHECK that Release()d objects are deleted when expected to (i.e. no ref-cycles
  or missing .dispose() calls) in the Java API.
- Create & Return webrtc::Traces at factory birth/death to be able to assert
  that _all_ threads started during the test are collected by the end.
- Name threads attached to the JVM more informatively for debugging.
- Removed a bunch of unnecessary scoped_refptr instances in
  peerconnection_jni.cc whose only job was messing with refcounts.

RISK=P2
TESTED=AppRTCDemo can be ended and restarted just fine instead of crashing on camera unavailability.  No more post-app-exit logcat lines.  PCTest.java now asserts that all threads are collected before exit.

BUG=2183
R=wu@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2005004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4534 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-12 23:26:21 +00:00
..
assets AppRTCDemo: replace the use of query-string parameters for pre-JB devices. 2013-07-29 19:07:33 +00:00
jni Adds trunk/talk folder of revision 359 from libjingles google code to 2013-07-10 00:45:36 +00:00
res Adds trunk/talk folder of revision 359 from libjingles google code to 2013-07-10 00:45:36 +00:00
src/org/appspot/apprtc PeerConnection shutdown-time fixes 2013-08-12 23:26:21 +00:00
AndroidManifest.xml Adds trunk/talk folder of revision 359 from libjingles google code to 2013-07-10 00:45:36 +00:00
ant.properties Adds trunk/talk folder of revision 359 from libjingles google code to 2013-07-10 00:45:36 +00:00
build.xml Adds trunk/talk folder of revision 359 from libjingles google code to 2013-07-10 00:45:36 +00:00
project.properties Adds trunk/talk folder of revision 359 from libjingles google code to 2013-07-10 00:45:36 +00:00
README Adds trunk/talk folder of revision 359 from libjingles google code to 2013-07-10 00:45:36 +00:00

This directory contains an example Android client for http://apprtc.appspot.com 

Prerequisites:
- Make sure gclient is checking out tools necessary to target Android: your
  .gclient file should contain a line like:
  target_os = ['android', 'unix']
  Make sure to re-run gclient sync after adding this to download the tools.
- Env vars need to be set up to target Android; easiest way to do this is to run
  (from the libjingle trunk directory):
  . ./build/android/envsetup.sh
  Note that this clobbers any previously-set $GYP_DEFINES so it must be done
  before the next item.
- Set up webrtc-related GYP variables:
  export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_java=1 $GYP_DEFINES"
  export JAVA_HOME=</path/to/JDK>
  export PATH=$JAVA_HOME/bin:$PATH
  To cause WEBRTC_LOGGING to emit to Android's logcat, add enable_tracing=1 to
  the $GYP_DEFINES above.
- When targeting both desktop & android, make sure to use a different output_dir
  value in $GYP_GENERATOR_FLAGS or you'll likely end up with mismatched ARM &
  x86 output artifacts.  If you use an output_dir other than out/ make sure to
  modify the command-lines below appropriately.
- Finally, run "gclient runhooks" to generate Android-targeting .ninja files.

Example of building & using the app:

cd <path/to/libjingle>/trunk
ninja -C out/Debug AppRTCDemo
adb install -r out/Debug/AppRTCDemo-debug.apk

In desktop chrome, navigate to http://apprtc.appspot.com and note the r=<NNN> room 
this redirects to.  Launch AppRTC on the device and enter the same <NNN> into
the dialog box.

Alternatively, replace the <NNN> from the desktop chrome into the following
command:
adb shell am start -a android.intent.action.VIEW -d '"https://apprtc.appspot.com/?r=<NNN>"'
This should result in the app launching on Android and connecting to the apprtc
page displayed in the desktop browser.

Yet another way to is to send the apprtc room URL to the Android device (e.g. using
https://chrome.google.com/webstore/detail/google-chrome-to-phone-ex/oadboiipflhobonjjffjbfekfjcgkhco)
and choose to open the URL with the AppRTCDemo app.