Android Question Finding contact address details

HARRY

Active Member
Licensed User
Longtime User
Hi,

I have to find the country, city and street part of the address of all my contacts. Does somebody know a simple method to do so?

Harry
 

HARRY

Active Member
Licensed User
Longtime User
Hi Erel,

I have stored for a contact first name ,last name, street, city, state, postal code and country. I need to get those back in order to ask Bing for the coordinates.
My device is a Samsung Se4 mini. I use B4A 5.02.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add this sub to ContactsUtils:
B4X:
'Returns a list with the contact's addresses.
Public Sub GetAddress(id As Long) As List
   Dim raw As List = GetData("vnd.android.cursor.item/postal-address_v2", Array As String("data1", "data4", "data10", "data7"), id, Null)
   Dim res As List
   res.Initialize
   For Each row() As Object In raw
     res.Add(row(0))
   Next
   Return res
End Sub
It will return a list with the full addresses.
 
Upvote 0
Top