Open SQLite database on sdcard

This is a discussion on Open SQLite database on sdcard within the Beginning Developers forums, part of the Android Development category; I'm new to Android development but I managed to do something with all the examples on the net. I do have a question howeever. Is ...

Results 1 to 4 of 4

Thread: Open SQLite database on sdcard

  1. #1
    Android Lurker odisej's Avatar
    Join Date
    Jul 2011
    Posts
    3

    Open SQLite database on sdcard

    I'm new to Android development but I managed to do something with all the examples on the net. I do have a question howeever. Is it possible to open SQLite database on sdcard? Right now I can only open databases in Data/Data/package name/databases folder. If is possible some kind of a tip would be greate as I can't find anything on the net.

  2. Android.net is the premier Android Forum. Registered users do not see these ads. .

  3. #2
    App Developer alostpacket's Avatar
    Join Date
    Jan 2011
    Location
    NY
    Posts
    240
    Thanked
    32 times
    Twitter
    alostpacket
    it's not possible using the API

    The trick most people try to use is to copy the DB over when it is first used.

  4. #3
    Android Lurker odisej's Avatar
    Join Date
    Jul 2011
    Posts
    3
    It is possible after all:

    File dbfile = new File("/sdcard/mydb.sqlite" );
    SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(dbfile, null);
    and

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_ST ORAGE"></uses-permission>

  5. #4
    App Developer alostpacket's Avatar
    Join Date
    Jan 2011
    Location
    NY
    Posts
    240
    Thanked
    32 times
    Twitter
    alostpacket
    hmm maybe I'm thinking of the assets folder, you might be right, sorry for the confusion.

Remove Ads

http://www.scramblerducati.org/

Sponsored Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Exception while creating android database
    By ahava in forum Beginning Developers
    Replies: 1
    Last Post: 05-17-2011, 05:22 AM
  2. Exception while creating android database
    By ahava in forum Introductions & Site Assistance
    Replies: 1
    Last Post: 05-17-2011, 05:22 AM
  3. Replies: 6
    Last Post: 04-01-2011, 08:51 AM
  4. Replies: 0
    Last Post: 03-14-2011, 12:41 PM
  5. Replies: 0
    Last Post: 02-28-2011, 12:39 PM

Search tags for this page

android copy sqlite database to sdcard
,
android open database
,

android open database from sd card

,
android open remote file
,
android open sqlite database
,
android open sqlite database from sd card
,
android open sqlite database on sd card
,
android open sqlite database sd card
,
android sqlite on sd card
,

android sqlite sd card

,

android sqlite sdcard

,
create database in sdcard android example
,
droid db opendatabase
,
permission for sqlite in android
,
read database from sd card android
Click on a term to search our sites for related topics.
Android Forum