-2

I making an application in which my requirement is to get the Recently Added or Edited or Deleted Contact in Phonebook. So is there is way to achieve this. Any help will be appreciated.

droidd
  • 1,361
  • 10
  • 15

1 Answers1

0

You need to show what you tried, so that we can write our answers based on your try.

First, make sure you have this:

    <uses-permission android:name="android.permission.READ_CONTACTS" />

According to the android docs, you can easily read contacts, and, to get specific selections (which is exactly what you want) you can:

Define a search text expression that retrieves rows for a specific contact's LOOKUP_KEY and the Data.MIMETYPE of the details you want. Enclose the MIMETYPE value in single quotes by concatenating a "'" (single-quote) character to the start and end of the constant; otherwise, the provider interprets the constant as a variable name rather than as a string value. You don't need to use a placeholder for this value, because you're using a constant rather than a user-supplied value.

Take a look at the different ways to get specific selection keys on contacts, so that you can get exactly what you want.

http://developer.android.com/training/contacts-provider/retrieve-details.html

Ruchir Baronia
  • 7,406
  • 5
  • 48
  • 83
  • I think you did not read my question rightly. Just read what i want. i want contact based on only 3 conditions that i mentioned. 1. Recently Added 2. Recently Edited 3. Recently Deleted. Now if you can guide me on this. it will be helpful – droidd Dec 15 '15 at 11:57