03-22-2010 07:24 PM
Hello. Blackberry newbie here, looking to port an iPhone app to the RIM world... The app in question uses SQLite to store product information and images. In the Java code on the BB, I attempt to open the DB at the location "file:///store/home/user/myDatabasefile.db" but it keeps saying that the SQL is incorrect or that the DB cannot be found. I believe the problem is that it cannot find the database as the SQL is simply "select * from mytable". The myDatabasefile.db exists in my project but I'm not sure how to reference it pathwise. Do I need to copy this file somehow onto the "device" which is the simulator for now? I've seen sample code but it always creates the DB from scratch. I've already created and populated my DB... Any help is appreciate. I guess this question will help when it comes time to really distro the application on real devices. I'll know how to copy it into the proper directory... Thanks in advance!
-Brian
03-22-2010 10:22 PM
Hi,
The database locations in your device are located as explained here http://docs.blackberry.com/en/developers/deliverab
When using the simulator, you must point your SDCard directory to any location on your computer (using the simulator menu Simulate->Change SD Card. Considering your DB files are right in this directory, you should be able to open it using "/SDCard/myDatabasefile.db".
Check this other document for reference: http://docs.blackberry.com/en/developers/deliverab
Regads
03-23-2010 05:14 PM
Thanks for the response! The first link you sent didn't work so I wasn't able to look at it. The second one I had already downloaded and that's where I got the path information for "/store/home/user". I expected the DB file I have to be copied to that location in lieu of the fact that I have not specified any SD card as existing in the simulator. Is this an incorrect assumption? I found a tutorial that suggests a routing to copy the file over "a location" as a byte array but I wasn't sure if that was the prescribed solution or even if it is applicable in my case. I found that method in the SQLiteDEMO project that came w/ 5.0... Today, to add insult to injury, my project, though compiling fine, is not getting copied to the Downloads folder in the Simulator. I'm not sure why. I've deleted all of the dmp files, etc. but still no dice. Any thoughts on either of these problems? I'm using the JDE instead of Eclipse if that helps. My project is the "Active" one and it builds fine. I've tried to copy the .cod file manually into the simulator but that doesn't work anymore either.
11-30-2010 02:46 PM
Guess I'm many months behind you, but having similar pains, i.e. downloading code to the simulator and I see nothing in the simulator downloaded apps directory. Did you manage to resolve this?
11-30-2010 03:53 PM
I don't know if you already did this. In the Run Configurations, Memory , check "Use PC file system for SD Card files" and set a path in your PC to store the files...