Team Planning (5.25)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.