如何在sdcard中创建SQLite数据库,并用于读写android [英] How to create SQLite database in sdcard ,and use for read and write android

查看:84
本文介绍了如何在sdcard中创建SQLite数据库,并用于读写android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQLite数据库做Mini项目我想在sdcard中存储数据库。帮我在sdcard中存储数据库。

我的代码看起来像 -

I am doing Mini project using SQLite database I want to store database in sdcard. Help me to store database in sdcard.
my code looks like -

SQLiteDatabase myDB= null;
try {
	myDB = this.openOrCreateDatabase("MAS", MODE_PRIVATE, null);
}
catch(Exception e)
{
 Toast.makeText(this, "Error in opening database", Toast.LENGTH_LONG).show();
}
finally 
{
 if (myDB != null)
  myDB.close();
}



请帮助我。


Please help me.

推荐答案

听起来你使用的是外部数据库,因为你也可以更容易地在其他地方修改,复制和粘贴数据库。



要做到这一点,你需要下载sqlite manager然后你会有用于创建和修改现有数据库的良好UI界面。要知道如何做到这一点,请参阅链接 [< a href =http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/target =_ blanktitle =New Window> ^ ]



也可以通过这个链接 Link2 [ ^ ]



尝试这些链接并告诉我们是否有效,如果不是,我们会再次为您提供帮助。





谢谢

Ganesh
sounds good that you are using external database, because it is easier for you to modify, copy and paste the database in some other place too.

To do that you need to download sqlite manager and there you will have the good UI interface for creating and modifying the existing database. To know how to do that see this Link[^]

also go thru this link Link2[^]

try these links and let us know if it works or not, if not we are here to help you again.


Thanks
Ganesh


这篇关于如何在sdcard中创建SQLite数据库,并用于读写android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆