"Android" Experiment 8 SQLite database Operation 2016.5.13

Source: Internet
Author: User

Experiment 8 SQLite Database operations

Purpose

Design a Personal Address book, master the development of the database under the Android platform, the personal Address Book mainly includes the contact list and contact details and other interfaces.

Requirements

The main interface of the program is the directory of contacts that displays the name of the contact on the phone. Click the contact's name to display the contact's details. The menu bar pops up after you press the MEMU key. Click the button on the menu bar to add contacts and delete contacts

Process

(1) Determine the data structure of the database. This procedure as long as a table, the contents and description of the table as shown in the table below

Field name

Data type

Description

Field name

Data type

Statement

_id

Integer

The number of the inserted record

Name

varchar

Contact Name

Phone

Varchar

Contact person's landline phone

Mobile

varchar

Mobile phone number

Email

Varchar

Address of the contact's mailbox

Post

varchar

Contact fixed

Addr

varchar

Contact the address of the recognized

Comp

varchar

Contact location

(2) The icon to be used to copy the program into the RES/DRAWABLE-MDPI directory

1) New Project

2) Modify the layout file Activity_main.xml

(3) Define string resource String.xml

(4) Development layout file Activity_main.xml is used to display the contact list.

(5) Create a new detail.xml in the layout directory to display the contact details, the code reference is as follows:

(3) Develop database auxiliary class Myopenhelper class, create a new Myopenhelper.java. The framework code is as follows

(4) The next step into the development of the mainactivity end, to achieve database additions, deletions, change records and other operations

(5) Create a new activity named Detailactivity.java, which realizes the contact details display function.

The "Expand Experiment" enables you to search contacts records by name or by phone.

Lab Report Requirements

1) write down the steps and contents of the experiment in detail;

2) detailed record of the problems found during the experiment and the method of solving the problem;

3) give the various pages in the process of running the program;

4) Submit documents include: Experimental report, source code, can run the installation program, all files packaging compression;

5) compression Package naming format: Professional + study number + name + experiment 8.rar

"Android" Experiment 8 SQLite database Operation 2016.5.13

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.