walterf25 Expert Licensed User Longtime User Apr 10, 2018 #1 Hello everyone, does any one know how to create custom fields with this class, i have a list of contacts i need to download from an online service which dumps the data in CSV format, i have all this part figured out, but i need to add all this information to the device's contacts, i need to add 3 custom fields Player 1, Player 2, and Player 3, is there a way to create, i've tried to write a function copying the code to add Notes from the class but it doesn't seem to work. Code: 'Adds a player name to the custom field Player Public Sub AddPlayer(Id As Long, player As String) Dim v As ContentValues v.Initialize v.PutString("data1", player) SetData("vnd.android.cursor.item/player", v, Id, True) End Sub Thanks in advanced for the help. Regards, Walter
Hello everyone, does any one know how to create custom fields with this class, i have a list of contacts i need to download from an online service which dumps the data in CSV format, i have all this part figured out, but i need to add all this information to the device's contacts, i need to add 3 custom fields Player 1, Player 2, and Player 3, is there a way to create, i've tried to write a function copying the code to add Notes from the class but it doesn't seem to work. Code: 'Adds a player name to the custom field Player Public Sub AddPlayer(Id As Long, player As String) Dim v As ContentValues v.Initialize v.PutString("data1", player) SetData("vnd.android.cursor.item/player", v, Id, True) End Sub Thanks in advanced for the help. Regards, Walter
DonManfred Expert Licensed User Longtime User Apr 10, 2018 #2 Maybe this helps: https://github.com/dkostyrev/SampleContacts ETA: I also found this info Check, where your contact is stored. If it is stored on your SIM, then you can't add any field. To add a field, you must export this contact to your phone first. Click to expand... Upvote 0
Maybe this helps: https://github.com/dkostyrev/SampleContacts ETA: I also found this info Check, where your contact is stored. If it is stored on your SIM, then you can't add any field. To add a field, you must export this contact to your phone first. Click to expand...
walterf25 Expert Licensed User Longtime User Apr 10, 2018 #3 DonManfred said: Maybe this helps: https://github.com/dkostyrev/SampleContacts ETA: I also found this info Click to expand... I'm looking for a quick solution, i'm not really in a mood to wrap a complete different library just to add this functionality to my app. But thanks for the link though Walter Upvote 0
DonManfred said: Maybe this helps: https://github.com/dkostyrev/SampleContacts ETA: I also found this info Click to expand... I'm looking for a quick solution, i'm not really in a mood to wrap a complete different library just to add this functionality to my app. But thanks for the link though Walter
BillMeyer Well-Known Member Licensed User Longtime User Apr 10, 2018 #4 Is this what you are possibly looking for: https://www.b4x.com/android/forum/t...ad-write-access-to-the-stored-contacts.30824/ Upvote 0
Is this what you are possibly looking for: https://www.b4x.com/android/forum/t...ad-write-access-to-the-stored-contacts.30824/
walterf25 Expert Licensed User Longtime User Apr 10, 2018 #5 BillMeyer said: Is this what you are possibly looking for: https://www.b4x.com/android/forum/t...ad-write-access-to-the-stored-contacts.30824/ Click to expand... No, that is the class i'am using, what i'm looking for is for a way to create custom fields on the contacts, i 'am already using that class to sync the contacts i download from an online service to the phone's contacts. Thanks, Walter Upvote 0
BillMeyer said: Is this what you are possibly looking for: https://www.b4x.com/android/forum/t...ad-write-access-to-the-stored-contacts.30824/ Click to expand... No, that is the class i'am using, what i'm looking for is for a way to create custom fields on the contacts, i 'am already using that class to sync the contacts i download from an online service to the phone's contacts. Thanks, Walter
Erel B4X founder Staff member Licensed User Longtime User Apr 10, 2018 #6 How do you see that your code doesn't work? The field you add will not appear in the contacts app. You should however be able to fetch it. Upvote 0
How do you see that your code doesn't work? The field you add will not appear in the contacts app. You should however be able to fetch it.
walterf25 Expert Licensed User Longtime User Apr 10, 2018 #7 Erel said: How do you see that your code doesn't work? The field you add will not appear in the contacts app. You should however be able to fetch it. Click to expand... Hi Erel, you might be right, if that is the case, why won't the field appear in my contacts? and is there a way to make it show up? Thanks, Walter Upvote 0
Erel said: How do you see that your code doesn't work? The field you add will not appear in the contacts app. You should however be able to fetch it. Click to expand... Hi Erel, you might be right, if that is the case, why won't the field appear in my contacts? and is there a way to make it show up? Thanks, Walter
Erel B4X founder Staff member Licensed User Longtime User Apr 11, 2018 #8 It is more complicated to make the contacts app show those fields. You will need to implement a sync adapter: https://developer.android.com/guide/topics/providers/contacts-provider.html#Sources Upvote 0
It is more complicated to make the contacts app show those fields. You will need to implement a sync adapter: https://developer.android.com/guide/topics/providers/contacts-provider.html#Sources