从Android应用程序的资源使用SQLite数据库应用程序、数据库、资源、Android

由网友(樱花.祭)分享简介:我已经开始Android的编程最近这么多多包涵:)I've started Android programming recently so bear with me :)我开发拥有全部保存在database.sql文件内容的应用程序。我实现了SQLiteOpenHelper的子类,并添加database.sql到我...

我已经开始Android的编程最近这么多多包涵:)

I've started Android programming recently so bear with me :)

我开发拥有全部保存在database.sql文件内容的应用程序。我实现了SQLiteOpenHelper的子类,并添加database.sql到我的项目资产。

I develop an app which has all of its content stored in database.sql file. I've implemented a subclass of SQLiteOpenHelper and added database.sql to my project assets.

public class DBHelper extends SQLiteOpenHelper
{
public DBHelper (Context ctx)
{
  super(ctx, "database.sql", null, 1);
}
}

这件事不能正常工作。我刚刚得到一个异常每次我尝试做未便与DB时间:(

This thing doesn't work. I just get an exception every time I try to do smth with DB :(

推荐答案

您需要覆盖的onCreate和的onUpdate还有,看看谷歌的例子这里

You need to override onCreate and onUpdate as well, have a look to google's example here

阅读全文

相关推荐

最新文章