Android Question Register receiver ADD_CONTACT

Pooya1

Active Member
Licensed User
Hi
I need update my contact database when user add or delete contact in device
I can get list contact every time in app but if user have 100 contact so it take a minute for get contacts
So it is better i register broadcast receiver about contact
Do android have CONTACT add or delete filter?
 

Pooya1

Active Member
Licensed User
It shouldn't take a minute to get 100 contacts. Use ContactsUtils.FindAllContacts with VisibleOnly = True.
Yes i use it
But suppose user have more than 500 contacts and i get list contacts in first
It is OK here
Bun i need app check user contacts and if user add new contact,app add it to database
If i use receiver for detect add or delete contact i can reload contacts in this event no each activity started
 
Upvote 0

Pooya1

Active Member
Licensed User
ContentObserver will not really help as it will only find changes while your app is running. There isn't any library that wraps it.

Measure the time it takes to get all contacts. It should be fast enough. If not then switch to ContentResolver.QueryAsync.
Get all contacts when your app resumes.
No i prefer use ContactUtil class,it is well
If you say so is it good solution
 
Upvote 0
Top