1. Get System Contact information
- Understand the Contactsprovider content provider app for your system
- Com.android.providers.contacts Bag
- Contact2.db Database
- Table Raw_contacts (Contact_id,display_name)
CONTACT_ID 3 4
Save the ID of each contact, one contact_id per contact
- Table data (mimetype_id,raw_contact_id,)
Save the contact's data by raw_contact_id to identify which contact the data belongs to and identify the type of the data by mimetype_id
- Table Mimetypes: Represents the type of data
- View: view_data: Integrating data tables and Mimetypes tables
- Get contact data from a content provider
- Authentication, permissions: Com.android.contacts or Contacts (previous version of authentication)
- Accessing the uri:content://com.android.contacts/raw_contacts of the Raw_contacts table
- Accessing the Uri:content://com.android.contacts/data of the View_data table
- Access to the system's contact information requires permission
- Android.permission.READ_CONTACTS
- Android.permission.WRITE_CONTACTS
- Show and get selected contacts
- displaying system contact information for queries through the ListView
A detailed description of the ListView
See: http://www.cnblogs.com/devinzhang/archive/2012/01/20/2328334.html
With Baseadapter
- When you select a contact, you should callback the data to the security Number edit box.
, 2, mobile phone anti-theft function realization
手机定位 、 报警音乐 、 远程擦除数据、 远程锁屏
1. How to accept Instructions
In the way of message push:
-Push messages in the form of sockets
Socket It is a long-connected protocol, and the HTTP protocol is a short-connection protocol, the socket communication may be connected by a firewall (connection but no message-inactive connections will be considered to consume memory will be digested by the firewall)
解决方法: 采取心跳机制方式来解决(每隔一段时间发送空包或者几字节的信息,会耗流量,但是会保持活跃状态) 不足: 必须要有联互联网 - 通过移动运营商的短信方式实现推送消息 (不能欠费、要有移动信号,扣费)
(This project is the use of this)
- 采用第三方应用框架实现推送 1. 即时通信框架 :xmpp
Send instructions by SMS
- Define a broadcast receiver that subscribes to text messages
Steps:
- Inherit broacastreceive, rewrite OnReceive (), and get SMS via intent
- Register the receiver and subscribe to SMS broadcast events
Android.provider.Telephony.SMS_RECEIVED
- Set priority android:priority= "1000"
- Truncation of broadcast delivery
Abortbroadcast ();
5. Need permission to receive SMS: Android.permission.RECEIVE_SMS
- Mobile Location function
- Mobile positioning method (Baidu map)
- GPS positioning, Beidou navigation
- WiFi Location: Network location (IP address), not very accurate
- Base station positioning (Huawei, ZTE)
- Location positioning of Android implementations
Locationmanager:
Permission required to get location information
- Play Alarm music function
One Button lock screen function
Remote Erase Data feature
Mobile Security Defender 05