SQLite database location restriction

by Nathan » Fri, 13 Nov 2009 04:12:26 GMT


Sponsored Links
 I'm reading this restriction on where SQLite databases should reside
on Android.

All databases, SQLite and others, are stored on the device in /data/
data/<package_name>/databases.

While this may be appropriate for small databases that begin and end
within an application's space with a few contacts, this seems rather
restrictive for a large multimedia database that may be used on other
platforms, including Windows, and then transferred to a phone.

In particular, you apparently can't put a database file on a storage
card - which I know end users will want to do.

If this restriction is firm
1. How big can a file get in this location? I'll guess this is OEM
dependent, but, for example, the Verizon Droid is advertising 16GB
preinstalled memory. How much of this would be accessible to
databases? Anything that hasn't been used by the file system yet?
2. Is /data/data/<package_name>/databases a user accessible location
that end users will be able to browse to and place files in?

Nathan

--



SQLite database location restriction

by Nathan » Fri, 13 Nov 2009 11:00:25 GMT


 It seems there is a hard restriction on where SQLite databases
reside.

All databases must be in /data/data/<package_name>/databases,
according to the spec. Specifically, they can't be on a storage card.

This seems ok if the database is a small one that begins and ends with
an adroid app. But for a 1 gig multimedia database that is transferred
from somewhere else, that is limiting.

If this restriction is firm:

1. Is this location user accessible? IE can an end user with an
unlocked phone copy files into there from their desktop computer or
storage card.
2. How much storage space is likely to be available in that location?.
On the 16G droid, for example, how. much of that 16G is accessible?

Thanks

--


Sponsored Links


SQLite database location restriction

by westmeadboy » Fri, 13 Nov 2009 15:22:11 GMT


  http://developer.android.com/intl/en/reference/android/database/sqlite/SQLiteDatabase.html #openOrCreateDatabase(java.io.File,
android.database.sqlite.SQLiteDatabase.CursorFactory)




--



SQLite database location restriction

by Nathan » Fri, 13 Nov 2009 15:44:17 GMT


 Yes, the method
public static SQLiteDatabase openOrCreateDatabase (File file,
SQLiteDatabase.CursorFactory factory)

makes it sound like you can open an arbitrary filename.

But the developer's guide
 http://developer.android.com/guide/topics/data/data-storage.html 

makes it sounds like you can't:

"All databases, SQLite and others, are stored on the device in /data/
data/package_name/databases."

Nathan






--



SQLite database location restriction

by westmeadboy » Fri, 13 Nov 2009 15:50:27 GMT


 Yes, I can see that is misleading. I'm sure they just mean that for
when you don't specify a File.

Have you tried putting it on the sdcard? I have an app, used by
thousands of users, where a 20MB+ sqlite db file is located on the
sdcard.

Hope this helps!






--



SQLite database location restriction

by Nathan » Sat, 14 Nov 2009 01:23:04 GMT


 


Yes, it does. That's what I needed to know. I hadn't tried to code it
yet - I was reading the manual for once and found this tidbit that
could have big implications.

Given your experience, the chance that it will seem to work and then
blow up later sounds pretty small.

Nathan

--



Other Threads

1. R: Strange behavior of the panel for developers of Android Market.

It seems likely to me that it's used for the carrier filter selection
in the "Upload an App" view.

String

-- 

2. Webkit browser

Yup, yg pake froyo harap dicoba
Tuh desire ama nexus kan banyaj yg froyo
Nyampe brapa tuh

@lutfihidayatr
i'm in love with google, but flirting with webOS




Menyambung thread di milis bb sebelah :D
Ada yang kasih link ini: http://bit.ly/9JB8X9
Untuk tes browser terutama di froyo.
Dan hasil test browser di bb slider 9800 as attached.

Gimana froyo?
Monggo dites.....
Saya udah froyoless :(

@yopiesuryadi
The Next Big Thing is Coming....

--
"Indonesian Android Community [id-android]"

3. Detect user idle time

4. Android Force close dialog

5. Video playback fails when played from 3DGallery in Froyo

6. About symbol searching scope of shared library

7. Tentang froyo