Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
885 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...