The forum is currently being migrated to a new host. While the migration happens, the old server is still available. Once the new machine is ready, I will copy the database to the new machine. Feel free to ask and answer questions in the meantime.

How do connect to ultralite database that is on my sd card.

asked 16 Apr '12, 13:39

Tejasvi's gravatar image

Tejasvi
1222
accept rate: 0%


Something like this will do:

Configuration config = DatabaseManager.createConfigurationFileAndroid(
    "/sdcard/Android/data/app.package.name/files/test.udb", getApplicationContext() );
Connection conn = DatabaseManager.connect( config );

permanent link

answered 16 Apr '12, 13:58

Andy%20Quick's gravatar image

Andy Quick
2.2k2737
accept rate: 45%

I tried this but i get this error "com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-954]: The database '/data/data/Tejash.Agni/goroute.udb' was not found" where goroute is my file name and tejash.agni is package in which database is stored

(16 Apr '12, 14:06) Tejasvi
Replies hidden

File paths in the Android file system are case-sensitive. Could that be the problem?

(16 Apr '12, 14:15) Andy Quick
2

You indicated that you were interested in accessing the database on an SDCard. The error you report looks like an internal file storage reference. A reference to an SDCard location will look more like:

    /mnt/sdcard/Android/data/com.sybase.repro/files/database.udb

I generally use the following approach in code:

    String dbPath = getApplicationContext().getExternalFilesDir(null)
            + "/database.udb";

For internal storage, the code I use looks like:

    String dbPath = getApplicationContext().getFilesDir()
            + "/database.udb";

and the resulting directory looks like:

    /data/data/com.sybase.repro/files/database.udb
(16 Apr '12, 15:05) Chris Keating
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×70

question asked: 16 Apr '12, 13:39

question was seen: 1,734 times

last updated: 16 Apr '12, 15:06