Code to fetch current city and country name with java and Appium

Hi…my application is reflecting current city and country dynamically so I need to verify if its correct. I require to get current location city and country.

Have you looked at get-geolocation?

http://appium.io/docs/en/commands/session/geolocation/get-geolocation/

yes This will get me lat long…but how to get name of city n country by this?

Tons of ways. Start with a google search:

https://www.google.com/search?q=how+to+get+city+from+latitude+and+longitude&oq=how+to+get+city+from+&aqs=chrome.0.0j69i57j0l4.11647j0j7&sourceid=chrome&ie=UTF-8

I meant through script

Plenty of scripts in there. That Stack Overflow link shows several very thorough examples.

There’s no reason that you can’t type ‘java’ on the end of the search:

https://www.google.com/search?ei=E1sfW4DdJIrd0gK56IfoDA&q=how+to+get+city+from+latitude+and+longitude+java&oq=how+to+get+city+from+latitude+and+longitude+java&gs_l=psy-ab.3..0i22i30k1l2.2518.3429.0.4005.5.5.0.0.0.0.91.394.5.5.0…0…1c.1.64.psy-ab…0.5.394…0.0.vg7kjfJ2czc