Android Open Source - MyLibReminder Persistence Helper






From Project

Back to project page MyLibReminder.

License

The source code is released under:

Apache License

If you think the Android project MyLibReminder 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 com.geonnave.mylibreminder;
// ww w . j a  v a2  s  .c  om
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class PersistenceHelper extends SQLiteOpenHelper {
   
    public static final String DB_NAME =  "MyLibReminder";
    public static final int VERSAO =  1;
     
    private static PersistenceHelper instance;
     
    private PersistenceHelper(Context context) {
        super(context, DB_NAME, null, VERSAO);
    }
     
    public static PersistenceHelper getInstance(Context context) {
        if(instance == null)
            instance = new PersistenceHelper(context);
         
        return instance;
    }
 
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(LoanDAO.SCRIPT_CREATE_TABLE_LOANS);
    }
 
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL(LoanDAO.SCRIPT_DELETE_TABLE);
        onCreate(db);
    }
 
}




Java Source Code List

com.geonnave.mylibreminder.AddLoan.java
com.geonnave.mylibreminder.AlarmReceiverActivity.java
com.geonnave.mylibreminder.LoanAlarmReceiver.java
com.geonnave.mylibreminder.LoanComparator.java
com.geonnave.mylibreminder.LoanDAO.java
com.geonnave.mylibreminder.Loan.java
com.geonnave.mylibreminder.MainActivity.java
com.geonnave.mylibreminder.PersistenceHelper.java