So I wrote some code for maps in my app, and it works on my phone just fine, sadly it does not work on my emulator which is not comfortable enough for me here is the code:
String searchString = mSearchText.getText().toString();
Geocoder geocoder = new Geocoder(this);
List<Address> list = new ArrayList<>();
try{
int i=0;
while(list.size()==0 && i<10) {
boolean a = geocoder.isPresent();
list = geocoder.getFromLocationName(searchString,1);
i++;
}
}catch(IOException e){
Log.d(TAG, "geoLocate: IOException " + e.getMessage());
}
So when I debug it I see that variable "a" is always false on my emulator.
I use android emulator for visual studio since I have an AMD processor (Ryzen 7 1800x) on which I installed google play store and google play services(map works just fine, just geocoder doesn't), now is there some way to fix it?
As I read on https://developer.android.com/reference/android/location/Geocoder.html website "The Geocoder query methods will return an empty list if there no backend service in the platform." Can I get the service somehow? Download it on my emulator or something like this?