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
Posts: 31
Registered: ‎03-06-2011
My Device: Not Specified
Accepted Solution

SD card Write Permissions

[ Edited ]

How do you get write permission to the removable microSD card?

 

I have the shared files permission in my application.

 

I have been using QFile via the following line:

 

QFile file( fileName );

if (!file.open(QIODevice::WriteOnly | QIODevice::Text) ){
//it failed to open the file for writing
}

 and if fileName is in the sdcard
 eg:

QString fileName = "/accounts/1000/removable/sdcard/ha";

 

 

it fails to open the file with write access and subsequently executes the code in the if statement. If I have it in the shared folder it successfully opens the file and lets me write to it

eg:

fileName = "/accounts/1000/shared/downloads/ha";

 

I have sucessfully opened and read existing files in both the shared folder and the sd card by replacing QIODevice::WriteOnly  by QIODevice::ReadOnly.

 

Anyone know how to gain write access to the sd card?

Highlighted
Developer
Posts: 31
Registered: ‎03-06-2011
My Device: Not Specified

Re: SD card Write Permissions

[ Edited ]

I have no idea what I did, but it allows me to save on the sd card now.

 

The porblem must have been somewhere else in the app. What I wrote above is correct,

 

There is also a slim chance the new sdk ficed the problem.