Back to project page nl.fhict.intellicloud.answers.android.
The source code is released under:
Apache License
If you think the Android project nl.fhict.intellicloud.answers.android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package nl.fhict.intellicloud.answers.backendcommunication; // ww w . ja v a 2 s.c o m import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import nl.fhict.intellicloud.answers.backendcommunication.IntellicloudDbContract.*; public class LocalStorageSQLiteHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "intellicloud_answers.db"; //Current version: initial database version //Please edit only if database structure has changed. private static final int DATABASE_VERSION = 1; // Database creation sql statements public LocalStorageSQLiteHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CreateStatements.CREATE_TABLE_ANSWERS); db.execSQL(CreateStatements.CREATE_TABLE_QUESTIONS); db.execSQL(CreateStatements.CREATE_TABLE_USERS); db.execSQL(CreateStatements.CREATE_TABLE_REVIEWS); db.execSQL(CreateStatements.CREATE_TABLE_FEEDBACK); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(LocalStorageSQLiteHelper.class.getName(), "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS " + ReviewsEntry.TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + QuestionsEntry.TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + AnswersEntry.TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + UsersEntry.TABLE_NAME); db.execSQL("DROP TABLE IF EXISTS " + FeedbackEntry.TABLE_NAME); onCreate(db); } }