Comments (11)
duplicate contact merging under the hood is a really messy thing, a contact could be merged from contacts with IDs like 3, 16 and 56. Do not change the way it is done now though, let's just use the ID that is used at showing the given contact on the main screen now.
from simple-contacts.
not sure, I guess I used 2 ways just as an extra check. Well, sorting by ID can have some glitches, but it is the best we can do so whatever :) Will be fixed in 6.15.1
from simple-contacts.
the only related field at contacts is LAST_TIME_USED
from simple-contacts.
@tibbi LAST_TIME_USED
is deprecated from API 29 and not available in published apps on any API level.
https://developer.android.com/reference/android/provider/ContactsContract.ContactOptionsColumns#LAST_TIME_CONTACTED
There is a CONTACT_LAST_UPDATED_TIMESTAMP
: https://developer.android.com/reference/android/provider/ContactsContract.ContactsColumns#CONTACT_LAST_UPDATED_TIMESTAMP.
But judging from this StackOverflow answer, it's pretty useless since it gets updated all the time when some background sync happens without the user actually changing anything: https://stackoverflow.com/a/57489435
The only somewhat viable option seems to be keeping our own cache of hashcodes for contacts, periodically check if they have changed, and record the timestamp of when that happened. But it seems too complicated and error-prone for such a small feature.
from simple-contacts.
On the other hand – installed this app and it seems to sort by created date, and even shows some contact entry number: https://play.google.com/store/apps/details?id=ibtidah.tav.reco.
Will investigate further.
from simple-contacts.
well it has been updated in 2019 the last time, guess that field was still available. And as they arent updating targetSDK anymore, it still works. We have some locally stored contacts too that are fully under our control, but it isnt worth adding for them only. You can try fetching all fields with "*" and parsing through the whole cursor to see if there is nothing useful. We could rely on the "ID" itself too as we dont really need the date and time, just their order.
from simple-contacts.
Yep, I just confirmed that this is how this apps works – it just sorts by contact's ID.
from simple-contacts.
we can rely on that too. We won't be able to mix the public contacts and ones stored in "Phone storage (not visible by other apps)", but I dont think it matters. People usually dont mix those either, just use one or another.
from simple-contacts.
There are 2 different contact ID fields:
RAW_CONTACT_ID
- https://developer.android.com/reference/android/provider/ContactsContract.DataColumns#RAW_CONTACT_IDCONTACT_ID
- https://developer.android.com/reference/android/provider/ContactsContract.RawContactsColumns#CONTACT_ID
Sometimes they contain different values, sometimes the same ones.
I tried sorting by both of them and RAW_CONTACT_ID
seems to give correct results for much more contacts, although for some contacts comparison by CONTACT_ID
is correct instead.
So I propose to use RAW_CONTACT_ID
, although it's still not a perfect solution.
from simple-contacts.
@tibbi What's the purpose of this SQL sort function? To get at least partially sorted list of contacts and then sort them again using compareTo()
? For example, if I change it to always return Phone.NUMBER
, sorting still works the same as before.
from simple-contacts.
When syncing between devices, IDs seem to get changed too. So if you're moving to a new phone, your contact IDs will be recreated.
from simple-contacts.
Related Issues (20)
- Import contact from automatic backup failed HOT 2
- [Feature request] Share contact by QR code HOT 5
- vcf export doesn't contain photos HOT 1
- Two sims, can't change "sim" set the default for dialer HOT 1
- Temporarily disable the spam filter HOT 1
- Messagerie instantanée (Instant Messaging) : Molly not shown
- not intuitive vcf import dialog
- [Bug] App refuses to open, crashes immediately (v6.22.7)
- Feature request: backup contacts to any folder
- Auto backup is not working HOT 2
- [Bug] Contacts visivble + [Feature request] ringtone group HOT 1
- Use system directory chooser to select location for automatic backups HOT 2
- Sync contact stop working when using a non-google account HOT 1
- [Feature Request] Filter by only account HOT 1
- Maximum number of contacts limit - 25,000 or no limits? HOT 2
- Allow for custom dates (X-ABDATE, X-ABLABEL)
- Cannot import contacts on GrapheneOS
- Sim card synced
- Debug sim
- Tuta contacts not available as source to show, contacts available in other apps though
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-contacts.