Chandu Raotole
Chandu Raotole

Reputation: 47

SQLite Database in external sdcar

i am newbie to android . . I have problem that how to get external storage directory.In my device it is storage/sdcard1 path.

but it is also not working.

How can I set external storage directory path to db ? PLease help.

Any answer will be appreciated.

Upvotes: 0

Views: 62

Answers (1)

user2493476
user2493476

Reputation:

Before answering this question I want you know something about the android framework.. Android contains default sqlite handling options which saves database file in internal storage directory
It is good practice to use it.. But still if you want to save in custom directory follow these instructions
By default android partitions the internal storage into a partition called SD card which can be accessed by calling frameworks Function

File Environment.getExternalStorageDirectory()

But on some devices there is an option have external memory card If that is your case you can do that by calling java function like this

new File("/mnt/sdcard1/");

Upvotes: 1

Related Questions