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
alexko
Posts: 7
Registered: ‎01-22-2013
My Device: BB10 Z30
My Carrier: MTS
Accepted Solution

How to access a file on SD card - Blackberry 10 device

I need to get access (create, write, read) to a file on SD card using Blackberry NDK for Blackberry 10.

 

Perhaps, some prefix should be added to the file path. But which?

 

Thanks.

 

Please use plain text.
Developer
dishooom
Posts: 103
Registered: ‎12-31-2012
My Device: Blackberry 9810
My Carrier: Verizon

Re: How to access a file on SD card - Blackberry 10 device

Please use plain text.
New Contributor
alexko
Posts: 7
Registered: ‎01-22-2013
My Device: BB10 Z30
My Carrier: MTS

Re: How to access a file on SD card - Blackberry 10 device

Thanks for pointing to SdCardInfo.

 

I meant to access SD card mounted into the device.

Please use plain text.
Developer
kunal_one
Posts: 145
Registered: ‎12-23-2012
My Device: BB10 Dev Alpha
My Carrier: wifi

Re: How to access a file on SD card - Blackberry 10 device

I am also intrested in accessing SD card, did you found any solution ?

Please use plain text.
Forums Advisor III
jerryg50
Posts: 1,169
Registered: ‎02-28-2009
My Device: Torch, Bold, Play Book, and Bluetooth HS-700
My Carrier: BELL

Re: How to access a file on SD card - Blackberry 10 device

When I connect my Z10 to the computer, I open Windows Explorer. I can see the Z10 as two drives. One of them is the phone's internal memory, and the other one is the SD card.  For identifying the card, you will recognize which one Windows mapped when you look at the contents. I am sure you know what you have in your phone.

 

Another way to access the second SD card (the one you optionally added), is to remove the card, and use it in a micro-SD adabtor to a card reader for your PC.

 

Jerry G.
Please use plain text.
Forums Advisor III
jerryg50
Posts: 1,169
Registered: ‎02-28-2009
My Device: Torch, Bold, Play Book, and Bluetooth HS-700
My Carrier: BELL

Re: How to access a file on SD card - Blackberry 10 device .

When I connect my Z10 to the computer, I open Windows Explorer. I can see the Z10 as two drives. One of them is the phone's internal memory, and the other one is the SD card.  For identifying the card, you will recognize which one Windows mapped when you look at the contents. I am sure you know what you have in your phone.

 

Another way to access the second SD card (the one you optionally added), is to remove the card, and use it in a micro-SD adabtor to a card reader for your PC.

 

Jerry G.
Please use plain text.
Developer
kunal_one
Posts: 145
Registered: ‎12-23-2012
My Device: BB10 Dev Alpha
My Carrier: wifi

Re: How to access a file on SD card - Blackberry 10 device .

Actually I was more interested in API or Path using which I can access content of SD Card in BB10 Application

 

Is there any know path which I can use in application to access SD card content ?

Please use plain text.
Developer
indy2718
Posts: 36
Registered: ‎01-16-2013
My Device: Z10
My Carrier: Telus

Re: How to access a file on SD card - Blackberry 10 device .

I logged into the device using ssh.  You can also open the "System information" perspective, select file navigator.   I see the following in the root  ( / ) directory:


lrwxrwxrwx   1 root      nto              34 Mar 25 12:12 sdcard -> /accounts/1000/shared/misc/android
lrwxrwxrwx   1 root      nto              31 Mar 25 12:12 sdcard2 -> /accounts/1000/removable/sdcard

The directory /sdcard2 seems to be what you want.  Inside it has 1000_shared group permissions.  Directories for books, camera, docs, music, etc.

 

 

Please use plain text.
Developer
kunal_one
Posts: 145
Registered: ‎12-23-2012
My Device: BB10 Dev Alpha
My Carrier: wifi

Re: How to access a file on SD card - Blackberry 10 device .

Thanks, This is what I was looking for. As I dont have device now, was not able to confirm the path.

Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: How to access a file on SD card - Blackberry 10 device .

Appologies for resurecting an old thread, but I just had to answer this one and this thread is one of the results for a search for this.

 

There is a native C method that returns the SD card path.  See removablemedia_info_get_device_path().

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.