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

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Regular Contributor
Posts: 77
Registered: ‎06-02-2012
My Device: Playbook, BB10
My Carrier: Orange

bb10 app internal directory listing

[ Edited ]

Hello,

Is there any way to get a list of directories and files from a directory inside my app?(in BB10)

E.g to get a a list of directory names from "local:///photos" (or "file://photos"), the reason I want to do this is because I want to have a big list of files and directories inside a directory embeded in my app, but I don't want to mantain an internal list of references to them.

 

I tried using a directory reader + unsandboxed filesystem but I can't seem to find the directory where the app is( I initially supposed is blackberry.io.home)

 

Highlighted
BlackBerry Development Advisor
Posts: 769
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: bb10 app internal directory listing

I think you may want this (https://developer.blackberry.com/html5/apis/blackberry.io.html)

 

blackberry.io.sharedFolder
Regular Contributor
Posts: 77
Registered: ‎06-02-2012
My Device: Playbook, BB10
My Carrier: Orange

Re: bb10 app internal directory listing

I've tried that example yesterday, but I couldn't manage to get it work in a sandboxed enviroment. It seems I need to put sandbox to false even to read .home directory, in the docs it says only for .sharedFolder you need to unsandbox the enviroment.

Anyway how to read from the .sharedFolder the contents embeded in my app, the files and directory structure packaged  with my app?

 

Thanks

 

PS: If you haven't seen this post yet, please take a look: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Inspector-Broken-in-last-BB10-up... 

BlackBerry Development Advisor
Posts: 769
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: bb10 app internal directory listing

You mean how to reference files packaged in your app?  You can refer to them with the "local://" prefix.

Regular Contributor
Posts: 77
Registered: ‎06-02-2012
My Device: Playbook, BB10
My Carrier: Orange

Re: bb10 app internal directory listing

I also know that Smiley Happy

But I can't read the contents of a directory within my app, programatically. I want to be able to add files and folders within my app without mantaining a reference to them within my app and without predefined names. My question is how can I read the virtual folder "local://' using the APIs?