Search in sources :

Example 16 with AppInfo

use of com.connectsdk.core.AppInfo in project butter-android by butterproject.

the class DIALService method launchNetflix.

@Override
public void launchNetflix(final String contentId, AppLaunchListener listener) {
    JSONObject params = null;
    if (contentId != null && contentId.length() > 0) {
        try {
            new JSONObject() {

                {
                    put("v", contentId);
                }
            };
        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    AppInfo appInfo = new AppInfo("Netflix");
    appInfo.setName(appInfo.getId());
    launchAppWithInfo(appInfo, params, listener);
}
Also used : JSONObject(org.json.JSONObject) JSONException(org.json.JSONException) AppInfo(com.connectsdk.core.AppInfo)

Example 17 with AppInfo

use of com.connectsdk.core.AppInfo in project butter-android by butterproject.

the class DIALService method launchApp.

private void launchApp(String appId, JSONObject params, AppLaunchListener listener) {
    if (appId == null || appId.length() == 0) {
        Util.postError(listener, new ServiceCommandError(0, "Must pass a valid appId", null));
        return;
    }
    AppInfo appInfo = new AppInfo();
    appInfo.setName(appId);
    appInfo.setId(appId);
    launchAppWithInfo(appInfo, listener);
}
Also used : ServiceCommandError(com.connectsdk.service.command.ServiceCommandError) AppInfo(com.connectsdk.core.AppInfo)

Aggregations

AppInfo (com.connectsdk.core.AppInfo)17 JSONObject (org.json.JSONObject)12 ServiceCommandError (com.connectsdk.service.command.ServiceCommandError)11 JSONException (org.json.JSONException)9 ResponseListener (com.connectsdk.service.capability.listeners.ResponseListener)6 ServiceCommand (com.connectsdk.service.command.ServiceCommand)6 LaunchSession (com.connectsdk.service.sessions.LaunchSession)2 ArrayList (java.util.ArrayList)2 JSONArray (org.json.JSONArray)2 SuppressLint (android.annotation.SuppressLint)1 URLServiceSubscription (com.connectsdk.service.command.URLServiceSubscription)1 RokuApplicationListParser (com.connectsdk.service.roku.RokuApplicationListParser)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 SAXParser (javax.xml.parsers.SAXParser)1