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
Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook

Access SD card

Hello,

 

I want to read images from sdcard. What path should i use to access it in QDirIterator ?

 

In simulator i see this path  "/accounts/1000/removable/sdcard" 

In a few forum posts i see "file:///SDCard/.."

 

Can any one please confirm if above works on device.

I would prefer not to use the full path. Can 1000 ever change ?

 

 

 

Thanks

 

 

Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook

Re: Access SD card

Ill ty to use 

           QDir::currentPath() + "/../../removable/sdcard"

 

Hopefully this will work on the device. Did not find sdcard path in any official documentation.

 

 

 

 

 

Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810

Re: Access SD card

Can 1000 ever change ?

No, the "1000" wont change. See the BB10 Filesystem explained here...

 

http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.ide.userguide/topic/files_base...

 

-Dishooom

Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook

Re: Access SD card

thanks .. good to know

Developer
torpesco
Posts: 121
Registered: ‎01-29-2011
My Device: Z10, PlayBook

Re: Access SD card

I used QDir::currentPath() + "/../../removable/sdcard" in an app also. A friend confirmed that it worked on a device.

 

Hadn't seen the "file:///SDCard/" one before. Have you tried that at all?

Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook

Re: Access SD card

I got QDir::currentPath() + "/../../removable/sdcard" from your post :smileyhappy: 

Was going to use full path but this is nicer and fits better with my app as i used relative path from home anyway.

 

QDir("file:///SDCard/").exists() returns false so it wont work. I thought there maybe some internal translation as there is no folder /SDCard/.

 

Btw , I see now that the simulator has /sdcard/ and /sdcard2/

/sdcard/ is internal storage (shared)

and /sdcard2/ is same as /accounts/1000/removable/sdcard/ so it must be for sd card.

 

I bank on your friends testing for now. Only have playbook.

I pushed app update for approval. Ill update this post if i get any complaints :smileyhappy:

 

 

 

 

 

 

 

 

 

 

Developer
torpesco
Posts: 121
Registered: ‎01-29-2011
My Device: Z10, PlayBook

Re: Access SD card


SpacemanSpiff wrote:

I got QDir::currentPath() + "/../../removable/sdcard" from your post :smileyhappy: 

Was going to use full path but this is nicer and fits better with my app as i used relative path from home anyway.

 ...

Btw , I see now that the simulator has /sdcard/ and /sdcard2/

/sdcard/ is internal storage (shared)

and /sdcard2/ is same as /accounts/1000/removable/sdcard/ so it must be for sd card.


Heh. Can't remember my own posts...

 

One note - /sdcard and /sdcard2 definitely won't work. They work on the simulator, but not actual devices.

Developer
SpacemanSpiff
Posts: 74
Registered: ‎01-08-2013
My Device: Playbook

Re: Access SD card

thanks for that , ill only use the ...removable... link.

wierd that they should have them on simulator.

Developer
torpesco
Posts: 121
Registered: ‎01-29-2011
My Device: Z10, PlayBook

Re: Access SD card

I should have been clearer -- I think the reason they don't work is due to access restrictions, there being fewer on the simulator.