Name Description Size
AppRTCAudioManager.java AppRTCAudioManager manages all audio related parts of the AppRTC demo. 23962
AppRTCBluetoothManager.java AppRTCProximitySensor manages functions related to Bluetoth devices in the AppRTC demo. 22464
AppRTCClient.java AppRTCClient is the interface representing an AppRTC client. 4064
AppRTCProximitySensor.java AppRTCProximitySensor manages functions related to the proximity sensor in the AppRTC demo. On most device, the proximity sensor is implemented as a boolean-sensor. It returns just two values "NEAR" or "FAR". Thresholding is done on the LUX value i.e. the LUX value of the light sensor is compared with a threshold. A LUX-value more than the threshold means the proximity sensor returns "FAR". Anything less than the threshold value and the sensor returns "NEAR". 6145
CallActivity.java Activity for peer connection call setup, call waiting and call view. 35208
CallFragment.java Fragment for call control. 4717
CaptureQualityController.java Control capture format based on a seekbar listener. 4128
ConnectActivity.java Handles the initial setup where the user selects which room to join. 27441
CpuMonitor.java Simple CPU monitor. The caller creates a CpuMonitor object which can then be used via sampleCpuUtilization() to collect the percentual use of the cumulative CPU capacity for all CPUs running at their nominal frequency. 3 values are generated: (1) getCpuCurrent() returns the use since the last sampleCpuUtilization(), (2) getCpuAvg3() returns the use since 3 prior calls, and (3) getCpuAvgAll() returns the use over all SAMPLE_SAVE_NUMBER calls. <p>CPUs in Android are often "offline", and while this of course means 0 Hz as current frequency, in this state we cannot even get their nominal frequency. We therefore tread carefully, and allow any CPU to be missing. Missing CPUs are assumed to have the same nominal frequency as any close lower-numbered CPU, but as soon as it is online, we'll get their proper frequency and remember it. (Since CPU 0 in practice always seem to be online, this unidirectional frequency inheritance should be no problem in practice.) <p>Caveats: o No provision made for zany "turbo" mode, common in the x86 world. o No provision made for ARM big.LITTLE; if CPU n can switch behind our back, we might get incorrect estimates. o This is not thread-safe. To call asynchronously, create different CpuMonitor objects. <p>If we can gather enough info to generate a sensible result, sampleCpuUtilization returns true. It is designed to never throw an exception. <p>sampleCpuUtilization should not be called too often in its present form, since then deltas would be small and the percent values would fluctuate and be unreadable. If it is desirable to call it more often than say once per second, one would need to increase SAMPLE_SAVE_NUMBER and probably use Queue<Integer> to avoid copying overhead. <p>Known problems: 1. Nexus 7 devices running Kitkat have a kernel which often output an incorrect 'idle' field in /proc/stat. The value is close to twice the correct value, and then returns to back to correct reading. Both when jumping up and back down we might create faulty CPU load readings. 18268
DirectRTCClient.java Implementation of AppRTCClient that uses direct TCP connection as the signaling channel. This eliminates the need for an external server. This class does not support loopback connections. 10653
HudFragment.java Fragment for HUD statistics display. 2868
PeerConnectionClient.java Peer connection client implementation. <p>All public methods are routed to local looper thread. All PeerConnectionEvents callbacks are invoked from the same looper thread. This class is a singleton. 51618
RecordedAudioToFileController.java Implements the AudioRecordSamplesReadyCallback interface and writes recorded raw audio samples to an output file. 4992
RoomParametersFetcher.java AsyncTask that converts an AppRTC room URL into the set of signaling parameters to use with that room. 8988
RtcEventLog.java 2236
SettingsActivity.java Settings activity for AppRTC. 14356
SettingsFragment.java Settings fragment for AppRTC. 822
TCPChannelClient.java Replacement for WebSocketChannelClient for direct communication between two IP addresses. Handles the signaling between the two clients using a TCP connection. <p> All public methods should be called from a looper executor thread passed in a constructor, otherwise exception will be thrown. All events are dispatched on the same thread. 9965
UnhandledExceptionHandler.java Singleton helper: install a default unhandled exception handler which shows an informative dialog and kills the app. Useful for apps whose error-handling consists of throwing RuntimeExceptions. NOTE: almost always more useful to Thread.setDefaultUncaughtExceptionHandler() rather than Thread.setUncaughtExceptionHandler(), to apply to background threads as well. 3089
util
WebSocketChannelClient.java WebSocket client implementation. <p>All public methods should be called from a looper executor thread passed in a constructor, otherwise exception will be thrown. All events are dispatched on the same thread. 9820
WebSocketRTCClient.java Negotiates signaling for chatting with https://appr.tc "rooms". Uses the client<->server specifics of the apprtc AppEngine webapp. <p>To use: create an instance of this object (registering a message handler) and call connectToRoom(). Once room connection is established onConnectedToRoom() callback with room parameters is invoked. Messages to other party (with local Ice candidates and answer SDP) can be sent after WebSocket connection is established. 15857