SQLite的s3db文件与Android应用程序连接 [英] SQLite s3db file to connect with android application
本文介绍了SQLite的s3db文件与Android应用程序连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是code需要被写入连接或连接的SQLite s3db文件与Android应用程序连接?其中,必须在code放在哪里?
What is the code that needs to be written to attach or connect a SQLite s3db file to connect with android application? Where must the code be placed?
推荐答案
在您的主要活动设置你的数据库。
In your main activity setup your DB.
private void setupDatabase()
{
Dbhelper myDbHelper = new Dbhelper(getApplicationContext());
myDbHelper = new Dbhelper(this);
try {
myDbHelper.createDataBase();
} catch (IOException ioe) {
throw new Error("Unable to create database");
}
}
这篇关于SQLite的s3db文件与Android应用程序连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文