I implemented Geofence in android application. I followed this link to implement \'Geofence\' in app. I am using \'Retrofit\' library to call \'HTTP\' request.
Ap
I had the same problem: "java.net.UnknownHostException: Unable to resolve host
"host_name": No address associated with hostname". Also Internet was available with all granted Android permissions (tested them all even at runtime).
But the solution was different. The reason was that our API-host "host_name" (e.g. http://xxx.yyyy.zz) was in LAN and was not able from outer network. The same issue may be caught if you are calling your company's outer "host_name" from company's LAN (it seems like "DNS Rebind attack" for server). To test it you should try to open used url in a browser when the device is (and when isn't) connected to Internet from a local LAN (e.g. company's Wi-Fi) and check if server response is correct.
The @Mangesh Sambare's problem was solved as he said above, but maybe this experience'll be helpful for somebody who're in the same situation as I was.