Android Open Source - Local Storage S Q Lite Helper

From Project

Back to project page


The source code is released under:

Apache License

If you think the Android project listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

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);

    public void onCreate(SQLiteDatabase db) {

    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            "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);   


Java Source Code List