SamsungDForum / LaunchApp

LaunchApp sample application
Other
1 stars 4 forks source link

Launch the installed apps #1

Open leo81267 opened 7 years ago

leo81267 commented 7 years ago

Hi ,

Is it possible to launch third party installed apps like YouTube , Hulu etc ?

ghost commented 7 years ago

Hi,

Yes, It is possible, if you have YouTube, Hulu "App ID". You can check App ID on TV SDK > Connection Explorer > Select Real Device > Installed Web Apps List.

leo81267 commented 7 years ago

Hi ,

Thanks for the info. It opens the app now with the AppId which I obtained from the Installed Web Apps List. I used the following :

``

   Map<String,Object> startArgs2 = new HashMap<String, Object>();
    Object payload = null;
    JSONObject test2 = new JSONObject();
    try {
        test2.put("content_id", 12146393);
    } catch (JSONException e) {
        e.printStackTrace();
    }
    payload = test2.toString();

    startArgs2.put("Message.PROPERTY_MESSAGE_ID", payload);

    mApplication = mService.createApplication(mApplicationId, mChannelId,startArgs2);``

In the "startArgs2" I gave the content Id. But it opened the App alone and did to go to the content.

are the arguments correct or am I missing something ? Is the startArgs standard way of passing the arguments for the Apps or is the format specific to the App which I try to open ?

ghost commented 7 years ago

This sample application is for launching from Tizen web application to Tizen web application. It is not for Android application.

You can find answer on SmartView guide and sample application. As I know, if you have only App ID of Tizen web application, you can launch it on Android application.

Thank you.

leo81267 commented 7 years ago

Hi ,

I tried in the Tizen Studio. the following is the one I used:

`

var paramAppId = '9Ur5IzDKqV.TizenYouTube';
var paramData = {
                    v: 'l8PYvi91WXgc',
                };
var appCtrlDataAry = [];
for(var keyName in paramData) {
    var temp = new tizen.ApplicationControlData(keyName, [paramData[keyName]]);
    appCtrlDataAry.push(temp);
}
var browserAppCtrl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/pick", (appCtrlDataAry[0].value)[0], null, null, appCtrlDataAry);
tizen.application.launchAppControl(
    browserAppCtrl,
    //appControl,
    paramAppId,
    function() {
        text = 'Jump Browser Success';
        console.log('App launched Success >>>>>>>>>>> : ' );
        log(text);
    },
    function(error) {
        console.log('App launched error >>>>>>>>>>> : ' );
        text = 'Jump Browser Error : ' + JSON.stringify(error);
        log(text);
    }, 
    null
);

`

As I told earlier , the YouTube app launchs . But it does not go to the content ? Is there any other way ?

capscrom commented 7 years ago

Hi, You can launch the App using launch API of Platform, But, you need to know the App's launching protocol to directly access to the content.

As I know, YouTube do not open the launching protocol on the TV publicly. so, I recommend to ask to YouTube or finding the other way on the YouTube developer site(https://www.youtube.com/yt/dev/).

Thank you.