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>