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

Java Development

Reply
Trusted Contributor
Posts: 236
Registered: ‎07-28-2010
My Device: Not Specified
My Carrier: Software Developer

How to give file system path in create method of URI class

Hi All,

            I want to store my SQLite databse in folder which I have created on my desktop i.e- DatabaseFolder

            my code is as following -

 

    URI myURI = URI.create("C:/Documents and Settings/mbhati/Desktop/DatabaseFolder/" + "MyTestDatabase.db");

 

 

but it is not creating any database inside my folder (i.e- DatabaseFolder)

I am not getting what is the problem , may be I am not giving proper location of folder wheather I need to add file: before CSmiley Very Happyocuments and Settings.....

 

Thanks to All

BlackBerry Development Advisor
Posts: 15,302
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: How to give file system path in create method of URI class

SQLite database need to be stored on the micro SD card or eMMC of the BlackBerry Smartphone.  Can you elaborate on what you are trying to achieve?

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
Trusted Contributor
Posts: 236
Registered: ‎07-28-2010
My Device: Not Specified
My Carrier: Software Developer

Re: How to give file system path in create method of URI class

I want to store Sqlite database in eMMC device memory Thanks
Highlighted
Developer
Posts: 19,633
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to give file system path in create method of URI class

First thing to note is that your BlackBerry is running in a Simulator on the PC, your code does not really know it is running in a PC.  So even though you are running on a PC, a Windows file name like:

C:/Documents and Settings/mbhati...

is right out. 

 

You need to use a Blackberry file name and then use the Simulator to 'attach' the SDCard as a directory on your PC.

 

I do not believe you can direct the eMMC to a specific directory, but you can for the SDCard.  So if you want to use a directory on your PC, your file name will look like:

 

"file:///SDCard/.....

 

If you must use the eMMC card, then you will need to use

 

"file:///store/.....

 

In both cases, the file name you will specify will be as known by the BlackBerry.  If you go into Media, and then use the  menu, you will find the menu item Explorer, you can use this to look around the directories and cards that your BlackBerry knows about.

 

 

New Contributor
Posts: 7
Registered: ‎05-08-2012
My Device: blackberry 9930 simulator
My Carrier: blackberry

Re: How to give file system path in create method of URI class

where is simulator actual memory located? if i download a file from simulator browser where it is store? i want the location of simulator actul memory not  SDCARD memory location please help me

BlackBerry Development Advisor
Posts: 15,302
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: How to give file system path in create method of URI class

You can't access files outside of the simulated SDCard outside of the BlackBerry smartphone simulator.  That stored data is located in the .dmp files in the simulator directory.

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