I've created an autocomplete address search text box. My problem is that I just can't make it work fine:
- Addresses are out of the bounding box usually, whatever I do - this didn't help.
- Finds addresses that doesn't contain the typed text.
- Finds less addresses, than max but it doesn't contain the good result.
- The result list is totally irrelevant sometimes.
- I need to type almost the whole address to get the correct result.
Source:
Geocoder geocoder = new Geocoder(this, Locale.getDefault());
List<Address> addresses = null;
try {
if (Geocoder.isPresent()) {
// Bounding box: Hungary
addresses = geocoder.getFromLocationName(text, 5, 46.13, 21.96, 48.89, 16.69);
}
} catch (IOException e) {
Log.v(tag, "Geocoding error: " + e.getMessage());
e.printStackTrace();
}
My aim is to make an address search text box which gets the same result as in Android Maps seach text box - except the previously typed/favourite addresses and etc., which is an other story.