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

Native Development

Reply
New Contributor
Posts: 2
Registered: ‎06-20-2012
My Device: Blackberry PlayBook 2.01
My Carrier: WIFI
Accepted Solution

navigator_open_file or other method to open local html file

Hi

 

To open .html file from app resourses I tried to use navigator_open_file function.

The problem is that browser can not open it because of access denied error.

So my question is how can I do this (open html file from application resources location) in other way or how can I avoid this access denied error ( I do not want to copy this file to sdcard or somwhere else ).

May be in NDK also available something like webview control that can be used inside application (this can resolve issue with access denied aswell :smileyhappy: )

 

Many thanks in advance,

Vitali

 

Developer
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: navigator_open_file or other method to open local html file

Hi vitali,

 

I'll link you to a previous post on the same subject. Read it completely, and you'll understand what your options are, and what the limitations are. 

 

http://supportforums.blackberry.com/t5/Native-Development/using-navigator-invoke-to-view-local-file-...

 

That thread should answer a lot of your questions. That being said, there apparently is a WebView control in Cascades that could accomplish what you're looking for. However, I've never used it, so I can't provide much help there. Moreover, it requires BB10, which means it's for the Dev Alpha device. if you're developing for the PlayBook, you do not have a WebView available, and you'll have to resort to the methods I mentioned in the link above.

 

Hope that helps.


Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
New Contributor
Posts: 2
Registered: ‎06-20-2012
My Device: Blackberry PlayBook 2.01
My Carrier: WIFI

Re: navigator_open_file or other method to open local html file

Thanks,

 

As I understand there is no any "normal" solution :smileyhappy: for this issue on PlayBook.

So I think I will use "shared location" variant, a little bit messy but what can we do :smileysad:

 

Thanks again,

Vitali

Developer
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: navigator_open_file or other method to open local html file

No problem. I'd appreciate it if you could like my post and mark it as the solution. It'll help others find it later. 

 

Also, I've written code that creates a server inside the app for the browser to open webpages from. It works extremely well, and allows you to ensure all of your webpage data is held inside your app's sandbox. It's not as hard as it sounds.


Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!