Read about retrieve contacts from android phone, The latest news, videos, and discussion topics about retrieve contacts from android phone from alibabacloud.com
Android SMS reads text messages and can get the sender/recipient's mobile phone number (Address). Contacts contacts can filter the mobile phone number (address), so SMS can use the mobile phone number (address) associate with a
As we know, Android's contacts and SMS management is developed via ContentProvider to the developer interface. Must start from the Contentresolver to solve. The Address book operation involves the use of the system source API, especially in the table URI above easy to confuse. In the next few articles, snails will continue to introduce Android communication management related knowledge of the article. These
1. ReviewThe previous study of the Android file storage, including storage on the SD card;2. Focus(1) Learn about one of the four components Content Provider(2) realize the contact person in the inquiry communication record(3) To implement new contacts to the communication record.3. Introduction(1) ContentProvider is more complex than other methods, but its function is revolutionary in other ways. (2) It en
of code in manifest, and the targetpackage must be the same as the package, otherwise it will be an error.In the test, we can run the test in Java mode by clicking on the method name right-outline, the test result is wrong I think I should be able to read.--------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------Third, the Data ViewAt this point, we ca
you are importing
Import the Android Studio project that we need
Phone and computer "umbilical cord", adb--android Debug Bridge
ADB is located under the Platform-tools directory of the SDK and starts cmd in this directory:
Enter ADB version to view ADB release number
Install the corresponding mobile
First, create a layout file. The interface is very simple. It is a search box and the following contact list:
Copy codeThe Code is as follows: Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
Android: background = "# FFD3D7DF"
Android: orientation = "vertical"
Mobile Security Guard ------ sim card binding reading contacts on the mobile phone anti-theft page, ------ sim
Implemented functions:
SIM card binding
Read contacts
Technical points:
SIM card binding
Get boot Broadcast
Read contacts
Use of SimpleAdapter
Data transfer between activities
SIM card binding
Ide
table:RAW_CONTACT_ID: The relative data in the Raw_contact table can be found by raw_contact_id.Data1 to data15 here to keep contact information contact name Contact Phone Number Email comments etc
Raw_contacts table:Version: edition number, for monitoring changesDeleted: Delete flag, 0 is default 1 means this row of data has been deletedDisplay_name: Contact NameLast_time_contacts: The Last contact time
"Description: Because these tables are very
*/*.
ReturnIf the user cancels the file pick, the {type: ' Cancel '} is returned.
Otherwise, return {type: ' Success ', uri,name,size} where the URI is the uri,name of the local document file is its name, and size is it in bytes.
Constacts
Provides access to the contact person of the opponent's machine system.
Expo.Contacts.getContactsAsync (Options)Gets a list of all the entries in the system contact. This returns a set of data related to the contact entry.
Parameters
Opt
With this article, I would like to explain how to create a searchable "contact list" Android application. With this application, users can browse through all saved contacts and search for contacts by their contact names by using the navigation buttons. The application can also display a photo of the contact, if available.
To browse the contact list, you can use
,2.class);Startactivityforresult (Intent, 0); Where the number 0 is the request code, in a moment will be used-Second Step-In 2.class:Intent Intent = new Intent ();Intent.putextra ("key", value);Setresult (0,intent); Where the number 0 is the return code, in a moment will be used-Step Three-In 1.class:Overriding the parent class method: Onactivityresult/**requestCode 为请求码*resultCode 为返回码*data为2.class传回来的Intent*/protectedvoidonActivityResult(intint resultCode, Intent data) { super.onAct
Next, the android content provider-content providers (1)
Contacts provider is a powerful and flexible component in Android. It manages the data in the system address book and provides external access interfaces to access and operate the system address book.
The organization chart of contacts provider is as follows:
It
the contacts in the Android system are also available through ContentProvider, where we get all the contacts, get contacts by phone number, add contacts, add contacts using transactions
Specific steps
1. In the mobile phone we click on "Contact" as shown in the picture.
2. Then click the "Contact" menu in the following figure.
3. On the phone's "menu" key, select "Import/Export".
4. Click the "Export to SIM card" menu.
5. Because I want to back up so I click on "Select All" as an example, choose Good, click on the top right corner of the screen "finish."
6. Finally click "OK" button.
7. Display the copy progress on
, and then use the view. getbottom obtains the position at the bottom of the parent window and compares the height of the group layout to vertical offset the group layout on the top to achieve the extrusion animation effect.
Finally, the androidmanifest. XML code is provided. to read the mobile phone contact, you must add the Android. Permission. read_contacts statement:
Now let's run the program, as show
Today's learning task: Read the main information (name and phone number) of all contacts on the mobile phone, and display it in listview
Main Content involved: 1) structure and usage of the contact API 2) role of the contentprovider component, Uri concept and usage 3) create a listview and bind data
1. Structure and usage of the contact API
Since
associated with the original contact table by ID. Let's take a look at the relationship between the three:
The top layer displays the aggregate contact table contacts, with the original contact table rawcontacts in the middle. Three accounts (two Gmail accounts and one Twitter account) store the contact information respectively, the bottom layer is the data table, which stores the contact information. The figure shows the three-tier architecture of
1 we have to install the mobile phone "Baidu Cloud" and then login, click "Found" found in the discovery panel "mobile phone back" function. As shown in figure:
2 Enter after we turn on the phone to retrieve the function, then we click on "select Allow" then we can through the software, shutdown, etc. can, but do
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.