use of wseemann.media.romote.tasks.RequestTask in project RoMote by wseemann.
the class SettingsActivity method performKeypress.
private void performKeypress(KeypressKeyValues keypressKeyValue) {
String url = CommandHelper.getDeviceURL(this);
KeypressRequest keypressRequest = new KeypressRequest(url, keypressKeyValue.getValue());
JakuRequest request = new JakuRequest(keypressRequest, null);
new RequestTask(request, new RequestCallback() {
@Override
public void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result) {
}
@Override
public void onErrorResponse(RequestTask.Result result) {
}
}).execute(RokuRequestTypes.keypress);
}
use of wseemann.media.romote.tasks.RequestTask in project RoMote by wseemann.
the class ChannelFragment method performLaunch.
private void performLaunch(String appId) {
String url = CommandHelper.getDeviceURL(getActivity());
LaunchAppRequest launchAppIdRequest = new LaunchAppRequest(url, appId);
JakuRequest request = new JakuRequest(launchAppIdRequest, null);
new RequestTask(request, new RequestCallback() {
@Override
public void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result) {
}
@Override
public void onErrorResponse(RequestTask.Result result) {
}
}).execute(RokuRequestTypes.launch);
}
use of wseemann.media.romote.tasks.RequestTask in project RoMote by wseemann.
the class DeviceInfoFragment method sendCommand.
private void sendCommand(String command) {
String url = command;
QueryDeviceInfoRequest queryActiveAppRequest = new QueryDeviceInfoRequest(url);
JakuRequest request = new JakuRequest(queryActiveAppRequest, new DeviceParser());
new RequestTask(request, new RequestCallback() {
@Override
public void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result) {
Device device = (Device) result.mResultValue;
List<Entry> entries = parseDevice(device);
mAdapter.addAll(entries);
mAdapter.notifyDataSetChanged();
DeviceInfoFragment.this.setListShown(true);
}
@Override
public void onErrorResponse(RequestTask.Result result) {
DeviceInfoFragment.this.setListShown(true);
}
}).execute(RokuRequestTypes.query_device_info);
}
use of wseemann.media.romote.tasks.RequestTask in project RoMote by wseemann.
the class ManualConnectionDialog method sendCommand.
private void sendCommand(String command) {
String url = command;
QueryDeviceInfoRequest queryActiveAppRequest = new QueryDeviceInfoRequest(url);
JakuRequest request = new JakuRequest(queryActiveAppRequest, new DeviceParser());
new RequestTask(request, new RequestCallback() {
@Override
public void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result) {
Device device = (Device) result.mResultValue;
mProgressLayout.setVisibility(View.GONE);
storeDevice(device);
}
@Override
public void onErrorResponse(RequestTask.Result result) {
mProgressLayout.setVisibility(View.GONE);
mErrorText.setVisibility(View.VISIBLE);
}
}).execute(RokuRequestTypes.query_device_info);
}
use of wseemann.media.romote.tasks.RequestTask in project RoMote by wseemann.
the class ManualConnectionFragment method sendCommand.
private void sendCommand(String command) {
String url = command;
QueryDeviceInfoRequest queryActiveAppRequest = new QueryDeviceInfoRequest(url);
JakuRequest request = new JakuRequest(queryActiveAppRequest, new DeviceParser());
new RequestTask(request, new RequestCallback() {
@Override
public void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result) {
Device device = (Device) result.mResultValue;
mProgressLayout.setVisibility(View.GONE);
storeDevice(device);
}
@Override
public void onErrorResponse(RequestTask.Result result) {
mProgressLayout.setVisibility(View.GONE);
mErrorText.setVisibility(View.VISIBLE);
}
}).execute(RokuRequestTypes.query_device_info);
}
Aggregations