Android Open Source - rebudget Database Helper






From Project

Back to project page rebudget.

License

The source code is released under:

Copyright (c) 2012, Alexander Lopatin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are me...

If you think the Android project rebudget 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.sbar.rebudget.database;
/*w  ww  .j av  a  2  s. c  o m*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import com.sbar.rebudget.Common;

public class DatabaseHelper extends SQLiteOpenHelper {
    public DatabaseHelper(Context context, String name, CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        Common.LOGI("DatabaseHelper.onCreate");
        db.execSQL("create table filters (id integer primary key autoincrement, category_id integer, wallet_id integer, outcome boolean, sms_address, sms_text_contains, cost_integer_regexp, cost_frac_regexp, remaining_integer_regexp, remaining_frac_regexp, store_regexp);");
        db.execSQL("create table categories (id integer primary key autoincrement, name, color integer, money_planned float, money_spent float, unique (name collate nocase asc));");
        db.execSQL("create table wallets (id integer primary key autoincrement, name, money float, unique (name collate nocase asc));");
        db.execSQL("create table stats (id integer primary key autoincrement, date integer, money_planned float, money_spent float);");
        db.execSQL("create table stores (id integer primary key autoincrement, name, category_id integer);");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        Common.LOGI("DatabaseHelper.onUpgrade " + oldVersion + " -> " + newVersion);
    }
}

// vim: textwidth=0





Java Source Code List

com.sbar.rebudget.Common.java
com.sbar.rebudget.FilterStruct.java
com.sbar.rebudget.Pair.java
com.sbar.rebudget.activities.AddFilterCostActivity.java
com.sbar.rebudget.activities.AddFilterRemainingActivity.java
com.sbar.rebudget.activities.AddFilterStoreActivity.java
com.sbar.rebudget.activities.AddOutcomeFilterActivity.java
com.sbar.rebudget.activities.CategoriesActivity.java
com.sbar.rebudget.activities.MainTabActivity.java
com.sbar.rebudget.activities.PlansActivity.java
com.sbar.rebudget.activities.StatsActivity.java
com.sbar.rebudget.activities.WalletsActivity.java
com.sbar.rebudget.database.DatabaseConnector.java
com.sbar.rebudget.database.DatabaseHelper.java
com.sbar.rebudget.receivers.SmsListener.java
com.sbar.rebudget.views.ChartView.java