Short answer: you cannot get structured data from this API . For some reason, Google has decided that this is not what people want on Android.
My colleague reported this issue with Google in order to request the same level of information that is provided to iOS and JavaScript users:
The longer answer is that your options are:
- You understand the clever way to parse this line. Unfortunately, the actual structure of streets / suburbs / cities / provinces is not consistent in different areas (for example, Cape Town in South Africa has a different proposal structure in Johannesburg in South Africa). Therefore, your parsing rules should be very smart.
- You are using a different Google API. The JavaScript API provides structured data for the corresponding call. This related question shows more details about this API. Unfortunately, Google recommends using this technique.
I believe that Google intends to give us this offer for the purpose of selecting an address, and not for obtaining structured address information. To get the best information, you need to get the lat / lng values ββby requesting a place id.
From these lat / lng values, you can flip the geolocation to get the correct address.
Unfortunately, Google APIs fail us again in this method.
- often you can take address A, resolve it to the given lat / lng, and resolve it to another address B, which may be close to A, but thatβs not the case. The API call is not commutative, as you might expect
I have had sufficient experience with these calls, and I would like for me to get another answer. If you want to stick with the Google Location APIs, you wonβt be able to get what you ask for.
source share