Search in sources :

Example 1 with QueryActiveAppRequest

use of com.jaku.request.QueryActiveAppRequest in project RoMote by wseemann.

the class NotificationService method sendStatusCommand.

private void sendStatusCommand() {
    String url = CommandHelper.getDeviceURL(this);
    QueryActiveAppRequest queryActiveAppRequest = new QueryActiveAppRequest(url);
    JakuRequest request = new JakuRequest(queryActiveAppRequest, new AppsParser());
    new RequestTask(request, new RequestCallback() {

        @Override
        public void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result) {
            List<Channel> channels = (List<Channel>) result.mResultValue;
            if (channels.size() > 0) {
                mChannel = channels.get(0);
                getAppIcon(mChannel.getId());
            }
        }

        @Override
        public void onErrorResponse(RequestTask.Result result) {
            Log.d(TAG, "That didn't work!");
        }
    }).execute(RokuRequestTypes.query_active_app);
}
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) AppsParser(com.jaku.parser.AppsParser) Channel(com.jaku.model.Channel) QueryActiveAppRequest(com.jaku.request.QueryActiveAppRequest) List(java.util.List)

Aggregations

JakuRequest (com.jaku.core.JakuRequest)1 Channel (com.jaku.model.Channel)1 AppsParser (com.jaku.parser.AppsParser)1 QueryActiveAppRequest (com.jaku.request.QueryActiveAppRequest)1 List (java.util.List)1 RequestCallback (wseemann.media.romote.tasks.RequestCallback)1 RequestTask (wseemann.media.romote.tasks.RequestTask)1 RokuRequestTypes (wseemann.media.romote.utils.RokuRequestTypes)1