I dont think you can use the SQLiteOpenHelper for anything but db's in
your data directory, but you can open them given any path (including
one to the sd card) with this:

http://code.google.com/android/reference/android/database/sqlite/SQLiteDatabase.html#openDatabase(java.lang.String,%20android.database.sqlite.SQLiteDatabase.CursorFactory,%20int)

On Oct 29, 10:12 am, wescorp <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I need to be able to work with databases on the sdcard.
>
> I've been using the following code snippet from the NotePad
> application and works perfectly on the emulator without using the
> sdcard.
>
> private static class DatabaseHelper extends SQLiteOpenHelper {
> DatabaseHelper(Context context) {
> super(context, "mydb.sqlite", null, 2);
>
> }
>
> When I include the path to the db as
>  "/sdcard/application/mydb.sqlite"
>
> the following error occurs
>  10-29 09:57:04.798: ERROR/AndroidRuntime(200): Caused by:
> java.lang.IllegalArgumentException: File /sdcard/application/
> mydb.sqlite contains a path separator
>
> The sdcard is properly emulated.
> The path exists.
>
> I've looked around but no obvious solution to me.
>
> Any help greatly appreciated.
>
> Cheers,
> Wes
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to