use of com.jaku.parser.DeviceParser 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 com.jaku.parser.DeviceParser 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 com.jaku.parser.DeviceParser 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