综合实例-联系人信息管理
准备知识
准备知识:
1.了解系统联系人的结构
2.表结构
方法:
1.查看电话应用的源码
2.利用搜索引擎查找相关信息
AndroidManifest.xml
PersonInfo.java
package com.example.contactsdemo;
public class PersonInfo {
private int _id;
private String name;
private String email;
private String phone;
private String address;
public int get_id() {
return _id;
}
public void set_id(int _id) {
this._id = _id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public String toString() {
return "PersonInfo{" +
"_id=" + _id +
", name='" + name + '\'' +
", email='" + email + '\'' +
", phone='" + phone + '\'' +
", address='" + address + '\'' +
'}';
}
}
MainActivity.java
package com.example.contactsdemo;
public class PersonInfo {
private int _id;
private String name;
private String email;
private String phone;
private String address;
public int get_id() {
return _id;
}
public void set_id(int _id) {
this._id = _id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public String toString() {
return "PersonInfo{" +
"_id=" + _id +
", name='" + name + '\'' +
", email='" + email + '\'' +
", phone='" + phone + '\'' +
", address='" + address + '\'' +
'}';
}
}