Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
dhinakaran123
Posts: 16
Registered: ‎06-16-2011
My Device: Blackberry Playbook
My Carrier: Software Engineer

Playbook : can't launching native Application

Hi All,

 

      I want lauch the native appllication like word to go from adope air script. i am QNXApplication.openFile(). It's not giving any exception but application is not lauch.  Any idea about this issue?



Please use plain text.
Developer
CoCopia
Posts: 231
Registered: ‎05-03-2011
My Device: PlayBook V1 and proud of it :-)
My Carrier: Legs

Re: Playbook : can't launching native Application

You need to pass the file type in openFile(); but you should also check to see if the file type is supported first using QNXApplication.supportedFileTypesVector array to see if the file is a valid file extension.

 

Keep the Forum productive and useful for all. Click Kudos button if I've helped you. Select Solved to help everyone.

PlayBook qualifying app - Pandoras' Lights
Blog - CoCopia.co.uk Catch me on Twitter cocopia_apps
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Playbook : can't launching native Application

What path are you passing to the function? Maybe show us a couple of lines of the relevant code.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Contributor
dhinakaran123
Posts: 16
Registered: ‎06-16-2011
My Device: Blackberry Playbook
My Carrier: Software Engineer

Re: Playbook : can't launching native Application

var supportFileTypes:Vector.<String> = qnx.system.QNXApplication.supportedFileTypes;
            for each (var value:smileyfrustrated:tring in supportFileTypes)
            {
                trace("supportedFileTypes :"+value);
            }

 

i can get supported file types. QNXApplication.qnxApplication.openFile( file.nativePath ); is not working what will i do?

 

Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Playbook : can't launching native Application

I don't recall if QNXApplication.openFile() actually works yet, but have you tried using the standard Flash method with File.openWithDefaultApplication() ?

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Playbook : can't launching native Application

I was not able to get either to work a month or so ago. If you can get it to work, please let us know and share what you did to get it to work with either the native or QNX APIs.
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Playbook : can't launching native Application

The other issue (and maybe why they are not implemented), is that the OS does not have a preference to select/manage preferred applications based on file extension.
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Playbook : can't launching native Application

[ Edited ]

I just tested with File.openWithDefaultApplication() and it works fine.

 

After copying the sample PDF from http://samplepdf.com into my media/documents folder over WiFi, I ran code that basically does this and it opened it directly in Adobe Reader:

var file:File = File.documentsDirectory.resolvePath('sample.pdf');
file.openWithDefaultApplication();

 

A similar test with QNXApplication.openFile() fails, even though the extension "pdf" is listed in QNXApplication.supportedFileTypes.

 

Oh, and it's well worth noting that to access files in the shared folders, you need the this in your blackberry-tablet.xml file: <action>access_shared</action> .


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Playbook : can't launching native Application

I added a note to my previous post pointing out that you need to add an <action> element to your blackberry-tablet.xml file in order to request that the user provide access to the shared/ folder for your app.

It's also important to realize that your app's own data folder is protected from all other apps, presumably including Reader, so I think it's unlikely that you could use this technique on anything within File.applicationStorageDirectory, period, regardless of permission settings. (The same would apply to File.applicationDirectory, of course.)

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Playbook : can't launching native Application

Good to know, then it must be the registration of the file types that is the issue.
Please use plain text.