use of com.connectsdk.service.webos.WebOSTVMouseSocketConnection in project butter-android by butterproject.
the class WebOSTVService method connectMouse.
private void connectMouse(final WebOSTVMouseSocketConnection.WebOSTVMouseSocketListener successHandler) {
if (mouseSocket != null)
return;
String uri = "ssap://com.webos.service.networkinput/getPointerInputSocket";
ResponseListener<Object> listener = new ResponseListener<Object>() {
@Override
public void onSuccess(Object response) {
try {
JSONObject jsonObj = (JSONObject) response;
String socketPath = (String) jsonObj.get("socketPath");
mouseSocket = new WebOSTVMouseSocketConnection(socketPath, successHandler);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onError(ServiceCommandError error) {
Log.w(Util.T, "Connect mouse error: " + error.getMessage());
}
};
ServiceCommand<ResponseListener<Object>> request = new ServiceCommand<ResponseListener<Object>>(this, uri, null, true, listener);
request.send();
}
Aggregations