-
Hello, I am working on integrating with the contacts-android, specifically concerning contact management features. I've encountered a scenario where a contact may have multiple notes assigned to them, although this is not a typical occurrence. However, upon fetching a contact's details via the current API implementation, it appears that only a single note is returned. I would appreciate it if you could consider extending the API functionality to handle the less common but possible case where a contact has multiple notes associated with it. This enhancement could improve the robustness and adaptability of the contact management system. Thanks for your attention to this matter, and I look forward to your response. Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 1 reply
-
Hey! Thanks for using these APIs! So, I wrote the entities such that a RawContact can only have one note. This is the same behavior that you see across all other contacts apps such as AOSP contacts and Google contacts. Even the iOS contacts app only allows one note per contact.
Keep in mind that a RawContact is different from a Contact. A Contact may have one or more RawContacts associated with it. In this case, the Contact may have more than one Note if it has two or more RawContacts each having a non-blank Note. Contacts having multiple Notes is already supported by the current APIs. Perhaps, this is the scenario you encountered? Please read this page of the docs; https://github.com/vestrel00/contacts-android/blob/main/docs/entities/about-api-entities.md In case you are new to contacts management, I strongly suggest reading the entire page I linked above so you can understand the one to many relationship between Contact -> RawContact -> Data (e.g. Note) If you believe the API should support more than one Note per RawContact, could you please attach a video of the occurrence? Can you reproduce it in the AOSP or Google Contacts app? When you open the AOSP or Google Contacts app and click on a Contact, it will display the aggregate Contact in the details screen. If that Contact has two or more RawContacts linked to it, then the details screen may show two or more Notes. If you try to edit that Contact, you will see that each RawContact can only have one Note. Did this answer your question? Let me know, thanks! 🙏 |
Beta Was this translation helpful? Give feedback.
-
So far I've only found the ability to enter multiple notes inside a single rawContact on oppo coloros, it doesn't appear on the AOSP or Google Contacts apps. Would you be open to considering this API modification? |
Beta Was this translation helpful? Give feedback.
-
Hmmm... I do not have an Oppo phone. I wonder if those notes are custom data mime types. Oppo might not be using the standard note mime type that AOSP and Google Contacts apps are using. OR, Oppo is not following the rule that there should only be one note per RawContact. Let's see if we can figure this out! I need you to do the following things for me.
Please let me know! |
Beta Was this translation helpful? Give feedback.
-
It depends on how Oppo implemented notes. Let's figure that out first before I answer this question 😃 |
Beta Was this translation helpful? Give feedback.
-
contacts provider table log |
Beta Was this translation helpful? Give feedback.
-
Thanks for the logs! I don't see any custom data there. Can you also do one more thing. View/edit RawContact that has two notes in the Google Contacts or AOSP Contacts app and screenshot what you see. Do you see the multiple notes? Do you only see one note? Do you see zero notes? |
Beta Was this translation helpful? Give feedback.
-
@vestrel00 |
Beta Was this translation helpful? Give feedback.
-
I do not see any of the contact data in your screenshot that is also in the log file. You could please attach a log file and a screenshot that corresponds to the log file? Thanks for your cooperation 🙏 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
It seems like all of those notes do belong to the same RawContact and that Google Contacts app is displaying all of the notes in view-mode. Here are my last questions before I give you an answer. In Google Contacts app...
Those should be my final questions. Once you answer them, I will look into what to do about supporting multiple notes using this library. Thanks for your cooperation! Note to self, could this be a new feature in the latest version of Android? Or is it really just Oppo ColorOS? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Thanks! That's all the info I need. I think I should be able to write extension functions to support your use case of adding/editing/removing multiple Notes per RawContact. I will keep the default behavior of one Note per RawContact. The multiple notes behavior will be opt-in. I'm a bit busy at work so this might take a while to do. I'll try to get it done some time in April. This will be part of the upcoming release; 0.3.2 😁 |
Beta Was this translation helpful? Give feedback.
-
I will convert this to a discussion and then create an issue for the new API. |
Beta Was this translation helpful? Give feedback.
-
@Yameteh, I created issue #343 ! It will be part of the upcoming release; 0.3.2. I'll try to get it out some time in April. |
Beta Was this translation helpful? Give feedback.
@Yameteh, I created issue #343 ! It will be part of the upcoming release; 0.3.2. I'll try to get it out some time in April.