Search in sources :

Example 1 with JakuRequest

use of com.jaku.core.JakuRequest 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);
}
Also used : RequestTask(wseemann.media.romote.tasks.RequestTask) RokuRequestTypes(wseemann.media.romote.utils.RokuRequestTypes) JakuRequest(com.jaku.core.JakuRequest) RequestCallback(wseemann.media.romote.tasks.RequestCallback) KeypressRequest(com.jaku.request.KeypressRequest)

Example 2 with JakuRequest

use of com.jaku.core.JakuRequest 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);
}
Also used : RequestTask(wseemann.media.romote.tasks.RequestTask) RokuRequestTypes(wseemann.media.romote.utils.RokuRequestTypes) JakuRequest(com.jaku.core.JakuRequest) RequestCallback(wseemann.media.romote.tasks.RequestCallback) LaunchAppRequest(com.jaku.request.LaunchAppRequest)

Example 3 with JakuRequest

use of com.jaku.core.JakuRequest 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);
}
Also used : RequestTask(wseemann.media.romote.tasks.RequestTask) Entry(wseemann.media.romote.model.Entry) QueryDeviceInfoRequest(com.jaku.request.QueryDeviceInfoRequest) RokuRequestTypes(wseemann.media.romote.utils.RokuRequestTypes) JakuRequest(com.jaku.core.JakuRequest) RequestCallback(wseemann.media.romote.tasks.RequestCallback) DeviceParser(com.jaku.parser.DeviceParser) Device(com.jaku.model.Device)

Example 4 with JakuRequest

use of com.jaku.core.JakuRequest 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);
}
Also used : RequestTask(wseemann.media.romote.tasks.RequestTask) QueryDeviceInfoRequest(com.jaku.request.QueryDeviceInfoRequest) RokuRequestTypes(wseemann.media.romote.utils.RokuRequestTypes) JakuRequest(com.jaku.core.JakuRequest) RequestCallback(wseemann.media.romote.tasks.RequestCallback) DeviceParser(com.jaku.parser.DeviceParser) Device(com.jaku.model.Device)

Example 5 with JakuRequest

use of com.jaku.core.JakuRequest 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);
}
Also used : RequestTask(wseemann.media.romote.tasks.RequestTask) QueryDeviceInfoRequest(com.jaku.request.QueryDeviceInfoRequest) RokuRequestTypes(wseemann.media.romote.utils.RokuRequestTypes) JakuRequest(com.jaku.core.JakuRequest) RequestCallback(wseemann.media.romote.tasks.RequestCallback) DeviceParser(com.jaku.parser.DeviceParser) Device(com.jaku.model.Device)

Aggregations

JakuRequest (com.jaku.core.JakuRequest)14 RequestCallback (wseemann.media.romote.tasks.RequestCallback)14 RequestTask (wseemann.media.romote.tasks.RequestTask)14 RokuRequestTypes (wseemann.media.romote.utils.RokuRequestTypes)14 KeypressRequest (com.jaku.request.KeypressRequest)6 Device (com.jaku.model.Device)3 DeviceParser (com.jaku.parser.DeviceParser)3 QueryDeviceInfoRequest (com.jaku.request.QueryDeviceInfoRequest)3 SearchRequest (com.jaku.request.SearchRequest)2 Bitmap (android.graphics.Bitmap)1 Channel (com.jaku.model.Channel)1 AppsParser (com.jaku.parser.AppsParser)1 IconParser (com.jaku.parser.IconParser)1 LaunchAppRequest (com.jaku.request.LaunchAppRequest)1 QueryActiveAppRequest (com.jaku.request.QueryActiveAppRequest)1 QueryIconRequest (com.jaku.request.QueryIconRequest)1 List (java.util.List)1 Entry (wseemann.media.romote.model.Entry)1