语言

Menu
Sites
Language
Implicit appControl registration and launch

The Tizen source leads me to fear that registering application control handlers on app installation might not be working right now, but it'll take me days to get familiar enough with that code to convince myself that this is true, or to fix it. Easier by far, I suspect, to just ask somebody... And, of course, I could just be doing this wrong. :j

I'm trying to work out precisely how Tizen's Application Control registration and launching mechanisms work. Launching apps by App ID is no problem; but launching apps by url and mime-type is proving difficult in the emulator.

I have two apps:

  • twiddle, a tiny web app that should launch apps via appControl.
  • grid6, a tiny web app which should catch those launched apps.

I'd like the link in twiddle's "index.html" to launch the main page of grid6. However, I haven't even been able to get twiddle's "launchCtrl" function to launch that page. Can you see what I might be doing wrong?

The relevant source code follows:

grid6, config.xml

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://grid6.appurl.org/" version="1.0.0" viewmodes="maximized">
    <tizen:app-control>
        <tizen:src name="index.html"/>
        <tizen:operation name="http://tizen.org/appcontrol/operation/view"/>
        <tizen:uri name="grid6.appurl.org://acaryaaa"/>
        <tizen:mime name="*/*"/>
    </tizen:app-control>
    <tizen:application id="1cQosCQNGV" required_version="1.0"/>
    <content src="index.html"/>
    <icon src="icon.png"/>
    <name>grid6</name>
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
    <tizen:privilege name="http://tizen.org/privilege/application.read"/>
    <tizen:setting screen-orientation="portrait" context-menu="enable" background-support="enable" encryption="disable" install-location="auto"/>
</widget>

twiddle, index.html

 

<body>
<a href="grid6.appurl.org:/acaryaaa">Glider, native</a>
<button onclick="launchCtrl('view', 'grid6:/acaryaaa', null)">Mime: null</button>
</body>

twiddle, main.js

 

// [...]

function launchCtrl(op, url, mime_type) {
    var appCtrl = new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/" + op, url, mime_type);
    console.log("*foom* Launching: (" + appCtrl.operation + ", " + appCtrl.uri + ", " + appCtrl.mime + ")" );

    try {
       tizen.application.launchAppControl(appCtrl, null,
       function() {console.log("NICE.");},
       function(e) {console.log("WTF:" + e.name + " " + e.message);},
       replyCB);
    } catch(e) {
      console.log("*boom* Launch failure: " + e.name + " " + e.message);
    }}

twiddle, config.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://twiddle.appurl.org/" version="1.0.0" viewmodes="maximized">
    <tizen:application id="Pl9e8i54bV" required_version="1.0"/>
    <content src="index.html"/>
    <icon src="icon.png"/>
    <name>twiddle</name>
    <tizen:privilege name="http://tizen.org/privilege/application.read"/>
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
</widget>

 

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

2 回复
Raghavendra Reddy Shiva
Thanks for your posting. We'll check the behaviour of launching apps by url and mime-type on the emulator and get back to you.
Raghavendra Reddy Shiva
The "Launch app control" interface has issues on the emulator. Please test your application on device, if available. Just to confirm the "Launch app control" interface functionality, have quickly verified launching gallery from an app and selecting an image and come back to the parent app with the results. This test worked fine on device (Ref Devcice-PQ) but the same doesn't work on emulator. Also below is the JIRA filed for the "launchAppControl" issue on emulator . https://bugs.tizen.org/jira/browse/TSDK-88 Till the issue is resolved, please use the explicit method to launch your second provider app on emulator. tizen.application.launchAppControl(appCtrl, ,........)