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
Developer
Posts: 131
Registered: ‎03-25-2009
My Device: Z30
My Carrier: Telus

where does Ripple's 'shared' folder map to on the Mac?

My app needs to play with some files. I am wondering where I could put them, so that they appear to be in .../shared/documents?

 

Thanks,

~S

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: where does Ripple's 'shared' folder map to on the Mac?

Can you clarify what you mean?

 

Remember Ripple is an emulator, not a simulator / OS so it provides emulated behavior - actual integration with file system may not be available.

 

For example, see the File API sample we have published in Github:

http://blackberry.github.com/WebWorks-Samples/kitchenSink/html/apis/file.html

 

Notice that when using the WebWorks-TabletOS platform, if you make a call to blackberry.io.dir.appDirs.shared.camera.path it returns file:///accounts/1000/appdata/emulatedapp/shared/camera which is the path to the shared folder within the Tablet OS.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 131
Registered: ‎03-25-2009
My Device: Z30
My Carrier: Telus

Re: where does Ripple's 'shared' folder map to on the Mac?

Let's say I am developing an image viewer. I need some .jpeg's to exist in file:///accounts/1000/appdata/emulatedapp/shared/photos, so that I can test my application.

Or say I am creating text editor. I need some sample documents to work with. How can I get sample documents into file:///accounts/1000/appdata/emulatedapp/shared/documents?

What about putting them in the SD card?
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: where does Ripple's 'shared' folder map to on the Mac?

Okay I understand, thanks for clarifying.

 

In this case, I'd suggest creating some sort of "isDevEnvironment()" JS method that you can use to override your /shared path with something from your own local dev folder.  This will give you a source of images, that you can use to test your application.

 

Suggestion isDevEnvironment == domain starts with localhost ?

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 131
Registered: ‎03-25-2009
My Device: Z30
My Carrier: Telus

Re: where does Ripple's 'shared' folder map to on the Mac?

Ok,

 

So I can actually access my local filesystem then? For example if I am on ripple, just call /Users/myname/dev/myappfolder/fakefsroot folder and look for stuff in it?  That will work fine, just didn't know I could access outside the PB's emulated FS.  I guess I should have tried that first. Smiley Happy


~S

Developer
Posts: 131
Registered: ‎03-25-2009
My Device: Z30
My Carrier: Telus

Re: where does Ripple's 'shared' folder map to on the Mac?

Ok, so I tried your solution. But ripple doesn't seem to like URL's on my PC's filesystem.

 

For example:

blackberry.io.dir.listDirectories('file:///Users/myname/Code/myproject/filesystem') throws an error saying:

TypeError: 'null' is not an object (evaluating 'b.children')  ripple.js:353.

 

What am I doing wrong?

Highlighted
Developer
Posts: 131
Registered: ‎03-25-2009
My Device: Z30
My Carrier: Telus

Re: where does Ripple's 'shared' folder map to on the Mac?

bump