1

is there a column in the database of contacts indicates the date added to the base or the last modification date, because I want a method used to retrieve the new add I found SEVERAL method but I did not understand, I am new to android

Edit : Means how to get the newly updated contacts.

surender8388
  • 474
  • 3
  • 12
user2282259
  • 155
  • 1
  • 3
  • 9

3 Answers3

0

you want to retrieve the number of new contacts since when?

if you adding contacts with your app then just get the number of contacts before you add any and save that value. then after the user has added contacts get the number again and find the difference between the previous number of contacts. that will be the number of new contacts, but the best way to do it would just be to keep an internal counter of when the user adds contacts.

Eluvatar
  • 2,265
  • 19
  • 24
  • the purpose of my question is how to recover each time the number of contacts to add db contatcs; i'm sorry for my bad language – user2282259 Apr 18 '13 at 16:57
0

I think you are looking for something like this, You want to get the updated contacts. have look here....

Contacts ContentObserver called randomly

Android notify when phone book is updated(Content Observer)

ContentObserver for listening contact changes

Community
  • 1
  • 1
surender8388
  • 474
  • 3
  • 12
0

Just make this change to your cursor query

     Cursor cursor = getActivity().getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, "_id DESC");
Surbhit Rao
  • 625
  • 6
  • 14