how can i make a share function, like on android platform

how can i make a share function, like on android platform

BY 31 May 2013 Web Application Development

Now, i have a text or a photo, i want to make a share function to use other app sending out it.

How can i do this work?

I notice, tizen provide ApplicationControl api, you can find special app with operation url, for example:”http://tizen.org/appcontrol/operation/share.

And then you can interaction with the requested app.

Now, i meet a problem, after i lunched the shareApp. i can’t get requestedAppControl in shareApp.

it’s my code of shareApp: app always log null

var reqAppControl = tizen.application.getCurrentApplication().getRequestedAppControl();
 
console.log(reqAppControl);
 
if (reqAppControl) {
    console.log(reqAppControl.appControl);
    reqAppControl.replyResult(‘text’);
}

and it’s my code of main app:

var appControl = new tizen.ApplicationControl(“http://tizen.org/appcontrol/operation/share”, null,“image/*”, null);
 
var appControlReplyCallback = {
    // callee sent a reply
    onsuccess : function(data) {
        for ( var i = 0; i < data.length; i++) {
            console.log(“#” + i + ” key:” + data[i].key);
            for ( var j = 0; j < data[i].value.length; j++) {
                console.log(”   value#” + j + “:” + data[i].value[j]);
           }
        }
    },
    // Something went wrong
    onfailure : function() {
    console.log(‘The launch application control failed’);
    }
}
 
tizen.application.launchAppControl(appControl, null, function() {
    console.log(“launch application control succeed”);
}, function(e) {
    console.log(“launch application control failed. reason: ” + e.message);
}, appControlReplyCallback);

 

Anybody can help me?

And how can i transfer data between the two app?

Written by