What did you do today?
On the basis of one of our small ledgers, we customized the database. There are labels, and there's a specific amount.
1 Packagecom.example.grouptext02;2 3 ImportAndroid.content.Context;4 Importandroid.database.sqlite.SQLiteDatabase;5 ImportAndroid.database.sqlite.SQLiteOpenHelper;6 ImportAndroid.util.Log;7 8 /*9 * Ten * Implement database Openhelper One * A * - */ - Public classDatahelperextendsSqliteopenhelper the { - Final StaticString DATABASENAME = "My_database.db"; - Final Static intVERSION = 1; - Final StaticString TABLENAME = "Consumptioninfor"; + Final StaticString ID = "ID"; - + Final StaticString label = "Label"; A Final StaticString money = "Money"; at - Public Static FinalString TAG = "My_tag";//Log - - PublicDatahelper (Context context) - { - Super(Context,databasename,NULL, VERSION); in } - to + Public voidonCreate (sqlitedatabase db) - { theLOG.V (Tag, "Wang Dash 1.1"); * $String sql2 = "CREATE TABLE" +Panax NotoginsengTABLENAME + "(" + -ID + "INTEGER PRIMARY KEY autoincrement," + theLABEL + "TEXT," + +Money + "TEXT");; ALOG.V (Tag, "Wang Dash 1.2"); theDb.execsql (SQL2);//Create a table +LOG.V (Tag, "Wang Dash 1.3"); - } $ $ Public voidOnupgrade (Sqlitedatabase arg0,intArg1,intarg2) - { -LOG.V (Tag, "Wang Dash 1.3"); the } -}
This is the initial version and is expected to join 1 later. NOTE 2. Consumption time record
What are you going to do tomorrow?
Development of the homepage
The difficulties encountered!
Final static String DATABASENAME = "my_database.db";
Final static int VERSION = 1;
Final static String TABLENAME = "Consumptioninfor";
Final static String id = "id";
Final static String label = "Label";
Final static String money = "money";
This part of the information, the top database type, and the version basically does not need to change, followed by the general ID then, the next is the definition of the data.
Team Planning (5.25)