Android Development (3)

Source: Internet
Author: User

Keywords:sqlite database , ListView, data adapter, content provider

SQLite Database : Sqliteopenhelper class; sqlitedatabase;

SQLITEOPENHELPER:A Helper class to manage database creation and version management.

Sqlitedatabase:exposes methods to manage a SQLite database.

The relationship between the two: Sqlitedatabase db = Helper.getwritabledatabase ();

Contentvalues: Adding and deleting the database is the data stored in the contentvalues;

Conmands: (SQL Statement implementation Additions and deletions)

Insert into account (Name,money) VALUES (string,string)

SELECT * FROM Account

Update account Set money = ' + ' where id= ' 1 '

Delete from account where id= ' 1

System API implementation and additions and changes

Db.insert (), Db.update () ...

Database transactions: Bank Transfer For example, let both sides change the value of the database at the same time to take effect

db.begintransaction ();    Try  {     ...     Db.settransactionsuccessful ();    finally {     db.endtransaction ();   

ListView:

    1. Custom data adapters: Inherit the Baseadapeter class;
      View view=view.inflate (mainactivity.  thisnull);

      Convert the XML file into a View object as a unit of the ListView.

    2. Arrayadapter:
    3. Simpleadapter:simpleadapter more complex points, the inside of the unit can have a variety of forms

content providers: to Be continued

Android Development (3)

Related Article

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.