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

Reply
Regular Contributor
andreyavram
Posts: 76
Registered: ‎06-02-2012
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)

 

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 602
Registered: ‎10-01-2009
My Carrier: Bell

Re: bb10 app internal directory listing

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

 

blackberry.io.sharedFolder
Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Regular Contributor
andreyavram
Posts: 76
Registered: ‎06-02-2012
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... 

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 602
Registered: ‎10-01-2009
My Carrier: Bell

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.

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Regular Contributor
andreyavram
Posts: 76
Registered: ‎06-02-2012
My Carrier: Orange

Re: bb10 app internal directory listing

I also know that :smileyhappy:

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?

Please use plain text.