06-30-2011 02:44 PM
I am trying to debug my app on a device, and previously, the app was running correctly, however, now I get a nullpointerexception when I try to access the sqlite database that is on the SDCard. I get this error exactly:
The exception is net.rim.device.api.database.DatabasePathException: Invalid path name. Path does not contains a proper root list. See FileSystemRegistry class for details.
The path was working fine earlier. Any ideas?
06-30-2011 02:51 PM
Here is my path:
String DB_NAME = "localdatabase.sql"; String dbLocation = "/SDCard/databases/CreativeCore/"; // Create URI URI uri = URI.create(dbLocation + DB_NAME); System.out.println("uri is created");
After this is a long try/catch where I try to open the database, but the databasepathexception is getting caught...
06-30-2011 05:12 PM
Can you see the SDCard when you use the Media 'Explorer'. Start the Media and press the menu, select "Explorer".
You might find this code from the SQL Demo, usefUL:
boolean sdCardPresent = false;
String root = null;
Enumeration e = FileSystemRegistry.listRoots();
root = (String)e.nextElement();
sdCardPresent = true;
Perhaps you have connected the BB to a PC and the SD Card is now in mass storage mode? Or perhaps the SD Card has dies?