Languages

Menu
Sites
Language
How to write a handler for additional mimetypes?

I'm trying to port a javascript-based ODF document viewer to Tizen, but I'm running into some problem getting downloaded files to be opened from the Download Manager list. The ideal behaviour would be to have the new viewer to launch when the built-in web-browser tries to load the file.

I'm having difficulty in getting the application to be launched from a ApplicationService call from another test app.

Within config.xml - I've added the mimetype and link to the relevant file within the Web Application.

<tizen:appservice src="odf_open_appservice.html"
    operation="http://tizen.org/appcontrol/operation/view"
    mime="application/vnd.oasis.opendocument.text"/>

Maybe I'm missing something elsewhere? (I had wondered whether one might need to register file extensions for mimetypes, for example,. but then a downloaded file should already have had its mimetype discovered when it was downloaded?

When I created a test app to launch for this mimetype against a local file, I received a "NotFoundError". I was able to replicate this against an image type, and the same error appeared to be given whether the target file did not exist, or when I specified a different mimetype in the call.

Any advice would be much appreciated,
Thanking you in anticipation,
Stuart

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

1 Replies
Raghu Kona
Hey Stuart, I tried working on application service and was able to launch an application through service provider. Where in I created a service which shows a popup to select an application (existing applications platform/user installed). and if I am right, the mime type will be handled by the browser. var service = new tizen.ApplicationService( 'http://tizen.org/appcontrol/operation/view', '/images/logo.png', 'IMAGE/*' ); try { tizen.application.launchService( service, // ApplicationService object null, // application ID function() { // launch success function console.log('Custom Service launched'); }, function(err) { // launch error function console.log('Custom Service launch failed: ' + err.message ); }, // service reply object custServiceReply ); } Feel free to get back if this does n't fix your problem.