0

i want to store my sqlite database directly on sdcard in android 6 , so how can i do this ?

I created my DB with

public DatabaseHelper(final Context context) {
    super(context, Environment.getExternalStorageDirectory()
            + File.separator + FILE_DIR
            + File.separator + DATABASE_NAME, null, DATABASE_VERSION);
}

but it stored in the internal memory

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
rheema
  • 41
  • 9
  • And what is wrong with this code? Don't you have to copy the SQLite file into the app's data directory in order to use it, anyway? – OneCricketeer Mar 05 '17 at 22:10
  • i didn't understand what you mean , i want to store the sqlite file in the external sdcard but with this code it was stored in the internal memory of the phone – rheema Mar 05 '17 at 22:19
  • Sugest to have a look here: http://stackoverflow.com/questions/14373863/how-to-store-sqlite-database-directly-on-sdcard http://stackoverflow.com/questions/4806181/sqlite-database-on-sd-card etc... In fact, searching "sql lite on sd card" on Google give a lot of solutions. – Peter Mar 05 '17 at 22:22
  • i tried a lot of solutions but it doesn't give me what i want and the file was stored in the internal memory – rheema Mar 05 '17 at 22:33
  • "internal memory" is an SD card (in most cases)... Not all devices have an "external" SD card, so I doubt you want this feature. – OneCricketeer Mar 06 '17 at 03:18
  • i want to store the sqllite file in the external sdcard (microsdcard) but it was stored in the internal sdcard – rheema Mar 06 '17 at 09:10

0 Answers0