【问题标题】:Galaxy gear s2 - Launche android application on phone from Tizen Web ApplicationGalaxy gear s2 - 从 Tizen Web 应用程序在手机上启动 android 应用程序
【发布时间】:2016-03-29 19:27:56
【问题描述】:

我正试图弄清楚如何发送某种意图以打开与我的 Tizen 可穿戴设备同步的 Android 设备上的应用程序。有什么建议吗?

我找到了这个链接。使用此代码,我可以启动三星商店。我需要启动 Google Play。我已经尝试将appid替换为:com.android.vending

https://developer.tizen.org/ko/forums/web-application-development/wearable-send-intent-phone?langswitch=ko

【问题讨论】:

    标签: tizen tizen-web-app samsung-gear-s2


    【解决方案1】:

    在 Nike Tizen 应用程序(打开 Google Play 商店)中进行大量研究和一些“逆向工程”后,我能够打开不同的应用程序。

    window.onload = function() {
        var appid = "com.samsung.w-manager-service";
        var type = "phone";
        var url = "market://details?id=br.org.cesar.punchcardreminder";
    
        var extra_data = [
                  new tizen.ApplicationControlData("msgId", ["mgr_install_host_app_req"]),
                  new tizen.ApplicationControlData("type", [type]),
                  new tizen.ApplicationControlData("deeplink", [url])];
    
        var appControl = new tizen.ApplicationControl(
                   "http://tizen.org/appcontrol/operation/default",
                   null,
                   null,
                   null,
                   extra_data);
    
        var appControlReplyCallback = {
                onsuccess: function(data) {
                    console.log("launchUrl reply success");
                    console.log("success: data = " + JSON.stringify(data));
                },
                onfailure: function() {
                    console.log("launchUrl reply failed");
                }
            };
    
        try {
            tizen.application.launchAppControl(
                     appControl,
                     appid,
                     function() { console.log("intentBorba", "launchUrl success"); },
                     function(err) { console.log("intentBorba", "launchUrl failed: " + err.message); },
                     appControlReplyCallback);
        }catch(err) {
            console.error("[launcher] " + err);
        }
    };
    

    当您开始使用新语言进行开发时,却没有直接记录如此简单的功能,这有点令人沮丧。我希望这个答案可以帮助一些人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-19
      • 1970-01-01
      • 1970-01-01
      • 2021-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多