brelto85 Active Member Licensed User Longtime User Feb 7, 2013 #1 hi, I have some problems with the library research contacts if I try to search for contacts that also connect to facebook (hence name), are found correctly but if the contact has no link with other networks (facebook, linkedin eccc ..) is not found Code: Dim wName as string Dim wContacts As Contacts2 Dim wList As List = wContacts.FindByName (wName, False, True, False) Example 1: wName: 'rossi' wList: Mario Rossi (have a link with facebook) Carlo Rossi (have a link with facebook) etc. ... Example 2: wName 'pippo' wList: empty (although he has a 'pippo' contact in the address book that is not connected to anything) Is there any parameter to be set or forcing search field? Alberto
hi, I have some problems with the library research contacts if I try to search for contacts that also connect to facebook (hence name), are found correctly but if the contact has no link with other networks (facebook, linkedin eccc ..) is not found Code: Dim wName as string Dim wContacts As Contacts2 Dim wList As List = wContacts.FindByName (wName, False, True, False) Example 1: wName: 'rossi' wList: Mario Rossi (have a link with facebook) Carlo Rossi (have a link with facebook) etc. ... Example 2: wName 'pippo' wList: empty (although he has a 'pippo' contact in the address book that is not connected to anything) Is there any parameter to be set or forcing search field? Alberto
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2013 #2 Are these contacts listed when you call wContacts.GetAll ? Upvote 0
brelto85 Active Member Licensed User Longtime User Feb 7, 2013 #3 yes the contacts are listed i've trying to force ToUpperCase before pass the name but the result don't change Upvote 0
yes the contacts are listed i've trying to force ToUpperCase before pass the name but the result don't change
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2013 #4 FindByName looks in the display name field. Maybe the name only appears on the name field? Note that you can create a custom query with GetContactsByQuery. Upvote 0
FindByName looks in the display name field. Maybe the name only appears on the name field? Note that you can create a custom query with GetContactsByQuery.
brelto85 Active Member Licensed User Longtime User Feb 9, 2013 #5 in my example the value 'pippo' it is in the "DisplayName" and in the field "Name" Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2013 #6 If the value is in the DisplayName field then it should return. I've tried to reproduce this problem here without success. Upvote 0
If the value is in the DisplayName field then it should return. I've tried to reproduce this problem here without success.
brelto85 Active Member Licensed User Longtime User Feb 11, 2013 #7 Also if i use GetContactsByQuery doesn't work Debugging GetContactsByQuery, i notice that the column 'name' is not present in SELECT Upvote 0
Also if i use GetContactsByQuery doesn't work Debugging GetContactsByQuery, i notice that the column 'name' is not present in SELECT
Erel B4X founder Staff member Licensed User Longtime User Feb 11, 2013 #8 Debugging GetContactsByQuery, i notice that the column 'name' is not present in SELECT Click to expand... You are correct. You will not be able to query the "name" field with GetContactsByQuery. The only solution that I can think of is to get all contacts (preferably asynchronously) and then search for the name yourself. Upvote 0
Debugging GetContactsByQuery, i notice that the column 'name' is not present in SELECT Click to expand... You are correct. You will not be able to query the "name" field with GetContactsByQuery. The only solution that I can think of is to get all contacts (preferably asynchronously) and then search for the name yourself.
brelto85 Active Member Licensed User Longtime User Feb 11, 2013 #9 ok, Alternatively there are other similar libraries like i can try? Upvote 0
brelto85 Active Member Licensed User Longtime User Feb 12, 2013 #10 it is possible that the problem is related to some permission as android.permission.READ_CONTACTS? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 12, 2013 #11 The permission should be added automatically when you use Contacts2. Upvote 0
brelto85 Active Member Licensed User Longtime User Feb 12, 2013 #12 I want to know if this problem i 've found just me (maybe it's a problem of my HTC one S) or other... Upvote 0
I want to know if this problem i 've found just me (maybe it's a problem of my HTC one S) or other...
Erel B4X founder Staff member Licensed User Longtime User Feb 13, 2013 #13 It works fine here (Galaxy Nexus). It was also tested on other phones. Upvote 0
brelto85 Active Member Licensed User Longtime User Feb 13, 2013 #14 Continuing to analyze the problem, i noticed that if i search a contact from name, does not find anything Suppose then that my contacts are (with display_name): "Paolo Rossi", "Carlo Rossi", "pippo" criteria = "Rossi" results = "Paolo Rossi", "Carlo Rossi" criteria = "Paolo" results = empty criteria = "pippo" results = empty I can maybe try to change some settings in my book to understand the problem? thanks Upvote 0
Continuing to analyze the problem, i noticed that if i search a contact from name, does not find anything Suppose then that my contacts are (with display_name): "Paolo Rossi", "Carlo Rossi", "pippo" criteria = "Rossi" results = "Paolo Rossi", "Carlo Rossi" criteria = "Paolo" results = empty criteria = "pippo" results = empty I can maybe try to change some settings in my book to understand the problem? thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 14, 2013 #15 Seems like your device stores the names in a non-standard way. I recommend you to get all contacts (without the notes and phone numbers). It should be quite fast. You can then use SearchView to search the items. Upvote 0
Seems like your device stores the names in a non-standard way. I recommend you to get all contacts (without the notes and phone numbers). It should be quite fast. You can then use SearchView to search the items.
brelto85 Active Member Licensed User Longtime User Feb 14, 2013 #16 thanks so much Erel i'll try this last mode Alberto Upvote 0
brelto85 Active Member Licensed User Longtime User Feb 15, 2013 #17 I found the cause!!!!!! The problem was the space in the name that i passed (that recovered from VoiceRecognition string) Code: Dim wList As List = wContacts.FindByName(Name.Trim, False, True, False) with ".Trim" method works perfect!! thanks Alberto Upvote 0
I found the cause!!!!!! The problem was the space in the name that i passed (that recovered from VoiceRecognition string) Code: Dim wList As List = wContacts.FindByName(Name.Trim, False, True, False) with ".Trim" method works perfect!! thanks Alberto