0

I need the user´s location for some features of my app and also want to pass it on to Admob requests to get targeted ads. I´m successfully getting the latitude and longitude however I don´t know how to use that to determine in which country the user is. Is there any way how we can do something like this?

Location country = 12.8654, 85.2072 //Nicaragua
Location userLocation = getCurrentLocation();

if (country.contains(userLocation){...}
Fran Tardencilla
  • 289
  • 1
  • 2
  • 13
  • Duplicate found using **web search** [`android country based on location`](https://www.google.com/search?q=android+country+based+on+location). Other answers are available from that search. – Andreas Apr 05 '20 at 20:25
  • I didn't *just* provide a google search, I closed the question with a link the another question that **has answers to your question** (see blue box up top saying "This question already has answers here"). Showing you answers to your question is not helpful? --- If you've already seen these valid answers, but they are not what you're looking for, how are we to know that? You haven't said anything about what you've already tried. See: [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – Andreas Apr 05 '20 at 20:43
  • Ok, thanks for the feedback. But did you check that question answers? On the comment made to the question says: "You definitely don't want to know where the user is. You want to know the user's locale setting. The accepted answer answers just that, but is otherwise totally inappropriate here, because search will point people here who actually want to know where the user really is." My question is not a duplicate, it just happens to have the same title than a question that's pointing to something different – Fran Tardencilla Apr 05 '20 at 20:54
  • Oh, you only looked at the *first* answer, huh? – Andreas Apr 05 '20 at 21:20

0 Answers0