Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
881 views
in Technique[技术] by (71.8m points)

android - SQLite Database in external Micro Sdcard

I want to know.

I have one external micro sd card in my tab.

I want to create a SQLite database inside my Micro sd card .

public static final String  DATABASE_FILE_PATH = "/extSdCard";

I am giving my path of external micro sd card but error showing.

Unable to open Database

Is it possible to create Database in external Memory card?

update:-

public static final String  DATABASE_FILE_PATH = "/extSdCard";
    public static final String  DATABASE_NAME = "mytest";

public SDcardDatabase(final Context context) {
        super(context,DATABASE_FILE_PATH +  DATABASE_NAME, null, 1);
    }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

We can create database in external sdcard by this given path.

"/mnt/externalSDcard/dbname"

for detail check this:-

SQLite Database in Samsung Tab2 (External Micro sd card)

https://android.stackexchange.com/questions/33182/why-is-the-sd-card-mounted-to-sdcard-external-sd-instead-of-sdcard-or-m


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...