2014-11-19 13:02:24 +00:00
|
|
|
/*
|
|
|
|
* libjingle
|
2015-01-20 21:36:13 +00:00
|
|
|
* Copyright 2014 Google Inc.
|
2014-11-19 13:02:24 +00:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
2015-01-20 21:36:13 +00:00
|
|
|
|
2014-11-19 13:02:24 +00:00
|
|
|
package org.appspot.apprtc;
|
|
|
|
|
|
|
|
import org.appspot.apprtc.RoomParametersFetcher.RoomParametersFetcherEvents;
|
|
|
|
import org.appspot.apprtc.WebSocketChannelClient.WebSocketChannelEvents;
|
|
|
|
import org.appspot.apprtc.WebSocketChannelClient.WebSocketConnectionState;
|
2015-01-09 19:34:06 +00:00
|
|
|
import org.appspot.apprtc.util.AsyncHttpURLConnection;
|
|
|
|
import org.appspot.apprtc.util.AsyncHttpURLConnection.AsyncHttpEvents;
|
|
|
|
import org.appspot.apprtc.util.LooperExecutor;
|
|
|
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
2014-11-19 13:02:24 +00:00
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import org.webrtc.IceCandidate;
|
|
|
|
import org.webrtc.SessionDescription;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Negotiates signaling for chatting with apprtc.appspot.com "rooms".
|
|
|
|
* Uses the client<->server specifics of the apprtc AppEngine webapp.
|
|
|
|
*
|
2015-01-05 17:39:43 +00:00
|
|
|
* <p>To use: create an instance of this object (registering a message handler) and
|
2014-11-19 13:02:24 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
public class WebSocketRTCClient implements AppRTCClient,
|
2015-01-06 22:24:09 +00:00
|
|
|
WebSocketChannelEvents {
|
2014-11-19 13:02:24 +00:00
|
|
|
private static final String TAG = "WSRTCClient";
|
2015-02-10 23:04:13 +00:00
|
|
|
private static final String ROOM_JOIN = "join";
|
|
|
|
private static final String ROOM_MESSAGE = "message";
|
|
|
|
private static final String ROOM_LEAVE = "leave";
|
2014-11-19 13:02:24 +00:00
|
|
|
|
|
|
|
private enum ConnectionState {
|
|
|
|
NEW, CONNECTED, CLOSED, ERROR
|
|
|
|
};
|
2014-12-05 20:11:06 +00:00
|
|
|
private enum MessageType {
|
2015-02-10 23:04:13 +00:00
|
|
|
MESSAGE, LEAVE
|
2014-12-05 20:11:06 +00:00
|
|
|
};
|
2015-01-06 22:24:09 +00:00
|
|
|
private final LooperExecutor executor;
|
2014-12-04 17:28:52 +00:00
|
|
|
private boolean initiator;
|
2014-11-19 13:02:24 +00:00
|
|
|
private SignalingEvents events;
|
|
|
|
private WebSocketChannelClient wsClient;
|
|
|
|
private ConnectionState roomState;
|
2015-02-10 23:04:13 +00:00
|
|
|
private RoomConnectionParameters connectionParameters;
|
|
|
|
private String messageUrl;
|
|
|
|
private String leaveUrl;
|
2014-11-19 13:02:24 +00:00
|
|
|
|
2015-02-10 23:04:13 +00:00
|
|
|
public WebSocketRTCClient(SignalingEvents events, LooperExecutor executor) {
|
2014-11-19 13:02:24 +00:00
|
|
|
this.events = events;
|
2015-02-10 23:04:13 +00:00
|
|
|
this.executor = executor;
|
|
|
|
roomState = ConnectionState.NEW;
|
2014-11-19 13:02:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
2015-01-06 22:24:09 +00:00
|
|
|
// AppRTCClient interface implementation.
|
2015-02-10 23:04:13 +00:00
|
|
|
// Asynchronously connect to an AppRTC room URL using supplied connection
|
|
|
|
// parameters, retrieves room parameters and connect to WebSocket server.
|
2014-11-19 13:02:24 +00:00
|
|
|
@Override
|
2015-02-10 23:04:13 +00:00
|
|
|
public void connectToRoom(RoomConnectionParameters connectionParameters) {
|
|
|
|
this.connectionParameters = connectionParameters;
|
2015-01-06 22:24:09 +00:00
|
|
|
executor.requestStart();
|
|
|
|
executor.execute(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
2015-02-10 23:04:13 +00:00
|
|
|
connectToRoomInternal();
|
2015-01-06 22:24:09 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void disconnectFromRoom() {
|
|
|
|
executor.execute(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
disconnectFromRoomInternal();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
executor.requestStop();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Connects to room - function runs on a local looper thread.
|
2015-02-10 23:04:13 +00:00
|
|
|
private void connectToRoomInternal() {
|
|
|
|
String connectionUrl = getConnectionUrl(connectionParameters);
|
|
|
|
Log.d(TAG, "Connect to room: " + connectionUrl);
|
2015-01-06 22:24:09 +00:00
|
|
|
roomState = ConnectionState.NEW;
|
|
|
|
wsClient = new WebSocketChannelClient(executor, this);
|
|
|
|
|
2015-02-10 23:04:13 +00:00
|
|
|
RoomParametersFetcherEvents callbacks = new RoomParametersFetcherEvents() {
|
|
|
|
@Override
|
|
|
|
public void onSignalingParametersReady(
|
|
|
|
final SignalingParameters params) {
|
|
|
|
WebSocketRTCClient.this.executor.execute(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
WebSocketRTCClient.this.signalingParametersReady(params);
|
|
|
|
}
|
|
|
|
});
|
2015-01-06 22:24:09 +00:00
|
|
|
}
|
2015-02-10 23:04:13 +00:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSignalingParametersError(String description) {
|
|
|
|
WebSocketRTCClient.this.reportError(description);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
new RoomParametersFetcher(connectionParameters.loopback, connectionUrl,
|
|
|
|
null, callbacks).makeRequest();
|
2015-01-06 22:24:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Disconnect from room and send bye messages - runs on a local looper thread.
|
|
|
|
private void disconnectFromRoomInternal() {
|
|
|
|
Log.d(TAG, "Disconnect. Room state: " + roomState);
|
|
|
|
if (roomState == ConnectionState.CONNECTED) {
|
|
|
|
Log.d(TAG, "Closing room.");
|
2015-02-10 23:04:13 +00:00
|
|
|
sendPostMessage(MessageType.LEAVE, leaveUrl, null);
|
2015-01-06 22:24:09 +00:00
|
|
|
}
|
|
|
|
roomState = ConnectionState.CLOSED;
|
|
|
|
if (wsClient != null) {
|
|
|
|
wsClient.disconnect(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-26 22:22:50 +00:00
|
|
|
// Helper functions to get connection, post message and leave message URLs
|
2015-02-10 23:04:13 +00:00
|
|
|
private String getConnectionUrl(
|
|
|
|
RoomConnectionParameters connectionParameters) {
|
|
|
|
return connectionParameters.roomUrl + "/" + ROOM_JOIN + "/"
|
|
|
|
+ connectionParameters.roomId;
|
2015-01-26 22:22:50 +00:00
|
|
|
}
|
|
|
|
|
2015-02-10 23:04:13 +00:00
|
|
|
private String getMessageUrl(RoomConnectionParameters connectionParameters,
|
|
|
|
SignalingParameters signalingParameters) {
|
|
|
|
return connectionParameters.roomUrl + "/" + ROOM_MESSAGE + "/"
|
|
|
|
+ connectionParameters.roomId + "/" + signalingParameters.clientId;
|
2015-01-26 22:22:50 +00:00
|
|
|
}
|
|
|
|
|
2015-02-10 23:04:13 +00:00
|
|
|
private String getLeaveUrl(RoomConnectionParameters connectionParameters,
|
|
|
|
SignalingParameters signalingParameters) {
|
|
|
|
return connectionParameters.roomUrl + "/" + ROOM_LEAVE + "/"
|
|
|
|
+ connectionParameters.roomId + "/" + signalingParameters.clientId;
|
2015-01-26 22:22:50 +00:00
|
|
|
}
|
|
|
|
|
2015-01-06 22:24:09 +00:00
|
|
|
// Callback issued when room parameters are extracted. Runs on local
|
|
|
|
// looper thread.
|
2015-02-10 23:04:13 +00:00
|
|
|
private void signalingParametersReady(
|
|
|
|
final SignalingParameters signalingParameters) {
|
2014-11-19 13:02:24 +00:00
|
|
|
Log.d(TAG, "Room connection completed.");
|
2015-02-10 23:04:13 +00:00
|
|
|
if (connectionParameters.loopback
|
|
|
|
&& (!signalingParameters.initiator
|
|
|
|
|| signalingParameters.offerSdp != null)) {
|
2014-11-20 21:16:12 +00:00
|
|
|
reportError("Loopback room is busy.");
|
2014-11-19 13:02:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2015-02-10 23:04:13 +00:00
|
|
|
if (!connectionParameters.loopback
|
|
|
|
&& !signalingParameters.initiator
|
|
|
|
&& signalingParameters.offerSdp == null) {
|
2014-12-04 17:28:52 +00:00
|
|
|
Log.w(TAG, "No offer SDP in room response.");
|
|
|
|
}
|
2015-02-10 23:04:13 +00:00
|
|
|
initiator = signalingParameters.initiator;
|
|
|
|
messageUrl = getMessageUrl(connectionParameters, signalingParameters);
|
|
|
|
leaveUrl = getLeaveUrl(connectionParameters, signalingParameters);
|
|
|
|
Log.d(TAG, "Message URL: " + messageUrl);
|
|
|
|
Log.d(TAG, "Leave URL: " + leaveUrl);
|
2014-11-19 13:02:24 +00:00
|
|
|
roomState = ConnectionState.CONNECTED;
|
2014-12-04 17:28:52 +00:00
|
|
|
|
|
|
|
// Fire connection and signaling parameters events.
|
2015-02-10 23:04:13 +00:00
|
|
|
events.onConnectedToRoom(signalingParameters);
|
2015-01-06 22:24:09 +00:00
|
|
|
|
|
|
|
// Connect to WebSocket server.
|
2015-02-10 23:04:13 +00:00
|
|
|
wsClient.connect(signalingParameters.wssUrl, signalingParameters.wssPostUrl,
|
|
|
|
connectionParameters.roomId, signalingParameters.clientId);
|
2014-11-19 13:02:24 +00:00
|
|
|
}
|
|
|
|
|
2015-01-06 22:24:09 +00:00
|
|
|
// Send local offer SDP to the other participant.
|
|
|
|
@Override
|
|
|
|
public void sendOfferSdp(final SessionDescription sdp) {
|
|
|
|
executor.execute(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
if (roomState != ConnectionState.CONNECTED) {
|
|
|
|
reportError("Sending offer SDP in non connected state.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
jsonPut(json, "sdp", sdp.description);
|
|
|
|
jsonPut(json, "type", "offer");
|
2015-02-10 23:04:13 +00:00
|
|
|
sendPostMessage(MessageType.MESSAGE, messageUrl, json.toString());
|
|
|
|
if (connectionParameters.loopback) {
|
2015-01-06 22:24:09 +00:00
|
|
|
// In loopback mode rename this offer to answer and route it back.
|
|
|
|
SessionDescription sdpAnswer = new SessionDescription(
|
|
|
|
SessionDescription.Type.fromCanonicalForm("answer"),
|
|
|
|
sdp.description);
|
|
|
|
events.onRemoteDescription(sdpAnswer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Send local answer SDP to the other participant.
|
|
|
|
@Override
|
|
|
|
public void sendAnswerSdp(final SessionDescription sdp) {
|
|
|
|
executor.execute(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
2015-02-10 23:04:13 +00:00
|
|
|
if (connectionParameters.loopback) {
|
2015-01-06 22:24:09 +00:00
|
|
|
Log.e(TAG, "Sending answer in loopback mode.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
jsonPut(json, "sdp", sdp.description);
|
|
|
|
jsonPut(json, "type", "answer");
|
|
|
|
wsClient.send(json.toString());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Send Ice candidate to the other participant.
|
2014-11-19 13:02:24 +00:00
|
|
|
@Override
|
2015-01-06 22:24:09 +00:00
|
|
|
public void sendLocalIceCandidate(final IceCandidate candidate) {
|
|
|
|
executor.execute(new Runnable() {
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
jsonPut(json, "type", "candidate");
|
|
|
|
jsonPut(json, "label", candidate.sdpMLineIndex);
|
|
|
|
jsonPut(json, "id", candidate.sdpMid);
|
|
|
|
jsonPut(json, "candidate", candidate.sdp);
|
|
|
|
if (initiator) {
|
|
|
|
// Call initiator sends ice candidates to GAE server.
|
|
|
|
if (roomState != ConnectionState.CONNECTED) {
|
|
|
|
reportError("Sending ICE candidate in non connected state.");
|
|
|
|
return;
|
|
|
|
}
|
2015-02-10 23:04:13 +00:00
|
|
|
sendPostMessage(MessageType.MESSAGE, messageUrl, json.toString());
|
|
|
|
if (connectionParameters.loopback) {
|
2015-01-06 22:24:09 +00:00
|
|
|
events.onRemoteIceCandidate(candidate);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Call receiver sends ice candidates to websocket server.
|
|
|
|
wsClient.send(json.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-11-19 13:02:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// WebSocketChannelEvents interface implementation.
|
2015-01-06 22:24:09 +00:00
|
|
|
// All events are called by WebSocketChannelClient on a local looper thread
|
|
|
|
// (passed to WebSocket client constructor).
|
2014-11-19 13:02:24 +00:00
|
|
|
@Override
|
|
|
|
public void onWebSocketOpen() {
|
2014-12-04 17:28:52 +00:00
|
|
|
Log.d(TAG, "Websocket connection completed. Registering...");
|
|
|
|
wsClient.register();
|
2014-11-19 13:02:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onWebSocketMessage(final String msg) {
|
|
|
|
if (wsClient.getState() != WebSocketConnectionState.REGISTERED) {
|
|
|
|
Log.e(TAG, "Got WebSocket message in non registered state.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
JSONObject json = new JSONObject(msg);
|
|
|
|
String msgText = json.getString("msg");
|
|
|
|
String errorText = json.optString("error");
|
|
|
|
if (msgText.length() > 0) {
|
|
|
|
json = new JSONObject(msgText);
|
|
|
|
String type = json.optString("type");
|
|
|
|
if (type.equals("candidate")) {
|
|
|
|
IceCandidate candidate = new IceCandidate(
|
2014-12-04 17:28:52 +00:00
|
|
|
json.getString("id"),
|
2014-11-19 13:02:24 +00:00
|
|
|
json.getInt("label"),
|
2014-12-04 17:28:52 +00:00
|
|
|
json.getString("candidate"));
|
2014-11-19 13:02:24 +00:00
|
|
|
events.onRemoteIceCandidate(candidate);
|
|
|
|
} else if (type.equals("answer")) {
|
2014-12-04 17:28:52 +00:00
|
|
|
if (initiator) {
|
|
|
|
SessionDescription sdp = new SessionDescription(
|
|
|
|
SessionDescription.Type.fromCanonicalForm(type),
|
|
|
|
json.getString("sdp"));
|
|
|
|
events.onRemoteDescription(sdp);
|
|
|
|
} else {
|
|
|
|
reportError("Received answer for call initiator: " + msg);
|
|
|
|
}
|
|
|
|
} else if (type.equals("offer")) {
|
|
|
|
if (!initiator) {
|
|
|
|
SessionDescription sdp = new SessionDescription(
|
|
|
|
SessionDescription.Type.fromCanonicalForm(type),
|
|
|
|
json.getString("sdp"));
|
|
|
|
events.onRemoteDescription(sdp);
|
|
|
|
} else {
|
|
|
|
reportError("Received offer for call receiver: " + msg);
|
|
|
|
}
|
2014-11-19 13:02:24 +00:00
|
|
|
} else if (type.equals("bye")) {
|
|
|
|
events.onChannelClose();
|
|
|
|
} else {
|
|
|
|
reportError("Unexpected WebSocket message: " + msg);
|
|
|
|
}
|
2015-01-05 17:39:43 +00:00
|
|
|
} else {
|
2014-11-19 13:02:24 +00:00
|
|
|
if (errorText != null && errorText.length() > 0) {
|
|
|
|
reportError("WebSocket error message: " + errorText);
|
|
|
|
} else {
|
|
|
|
reportError("Unexpected WebSocket message: " + msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (JSONException e) {
|
|
|
|
reportError("WebSocket message JSON parsing error: " + e.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onWebSocketClose() {
|
|
|
|
events.onChannelClose();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onWebSocketError(String description) {
|
|
|
|
reportError("WebSocket error: " + description);
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
// Helper functions.
|
|
|
|
private void reportError(final String errorMessage) {
|
|
|
|
Log.e(TAG, errorMessage);
|
2015-01-06 22:24:09 +00:00
|
|
|
executor.execute(new Runnable() {
|
|
|
|
@Override
|
2014-11-19 13:02:24 +00:00
|
|
|
public void run() {
|
|
|
|
if (roomState != ConnectionState.ERROR) {
|
|
|
|
roomState = ConnectionState.ERROR;
|
|
|
|
events.onChannelError(errorMessage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Put a |key|->|value| mapping in |json|.
|
|
|
|
private static void jsonPut(JSONObject json, String key, Object value) {
|
|
|
|
try {
|
|
|
|
json.put(key, value);
|
|
|
|
} catch (JSONException e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-06 22:24:09 +00:00
|
|
|
// Send SDP or ICE candidate to a room server.
|
|
|
|
private void sendPostMessage(
|
|
|
|
final MessageType messageType, final String url, final String message) {
|
2015-02-10 23:04:13 +00:00
|
|
|
String logInfo = url;
|
|
|
|
if (message != null) {
|
|
|
|
logInfo += ". Message: " + message;
|
2014-12-04 17:28:52 +00:00
|
|
|
}
|
2015-02-10 23:04:13 +00:00
|
|
|
Log.d(TAG, "C->GAE: " + logInfo);
|
2015-01-06 22:24:09 +00:00
|
|
|
AsyncHttpURLConnection httpConnection = new AsyncHttpURLConnection(
|
|
|
|
"POST", url, message, new AsyncHttpEvents() {
|
|
|
|
@Override
|
2015-01-09 19:34:06 +00:00
|
|
|
public void onHttpError(String errorMessage) {
|
2015-01-06 22:24:09 +00:00
|
|
|
reportError("GAE POST error: " + errorMessage);
|
2014-11-19 13:02:24 +00:00
|
|
|
}
|
|
|
|
|
2015-01-06 22:24:09 +00:00
|
|
|
@Override
|
2015-01-09 19:34:06 +00:00
|
|
|
public void onHttpComplete(String response) {
|
2015-01-06 22:24:09 +00:00
|
|
|
if (messageType == MessageType.MESSAGE) {
|
|
|
|
try {
|
|
|
|
JSONObject roomJson = new JSONObject(response);
|
|
|
|
String result = roomJson.getString("result");
|
|
|
|
if (!result.equals("SUCCESS")) {
|
|
|
|
reportError("GAE POST error: " + result);
|
|
|
|
}
|
|
|
|
} catch (JSONException e) {
|
|
|
|
reportError("GAE POST JSON error: " + e.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
httpConnection.send();
|
2014-12-04 17:28:52 +00:00
|
|
|
}
|
2014-11-19 13:02:24 +00:00
|
|
|
}
|