on 2012 Sep 20 1:09 PM
I've been trying so hard to connect to an UltraLite database stored on sdcard Android device. The error thrown is : Error J[-405], cannot create database "/mnt/sdcard/Android/data/Pedido_hh.udb". But I want to connect to that database and it always tries to create a new one. This is a part of the code used :
String dbPath = Environment.getExternalStorageDirectory().getPath() + "/Android/data/Pedido_hh.udb";
try{ // Define the database properties using a Configuration object ConfigFileAndroid config = DatabaseManager.createConfigurationFileAndroid(dbPath, this); // Connect, or if the database does not exist, create it and connect Connection _conn; try{ _conn = DatabaseManager.connect(config); } catch ( ULjException e) { _conn = DatabaseManager.createDatabase(config); } } catch ( ULjException e) { Log.e("HelloUltraLite", e.toString()); } }
Also I'd Like to know how can I create an UltraLiteJ Database using my PC and then use it on my Android Device.
PD: I'm using SQL Server AnyWhere 12.0.1 and Eclipse y SDK 2.2
Request clarification before answering.
Andy Quick says this:
I believe the problem is a permissions issue; the path to the database files should be something like /mnt/sdcard/Android/data/package-name/files/a.udb, where package-name is the package name of the application.
The application looks like it is failing to create the database, and then having to try again each time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
29 | |
9 | |
8 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.