How to determine the location (country) of a user using my app?

I would like to know the location of a user using my app.

I don’t need exact or accurate location, but I just want to know which country the app is currently being used. For example, USA, France, China, Thailand, etc.

I checked out the GPS functions in Corona, do I really need to use GPS if I don’t need very accurate location. If I need to use GPS, how to do it to determine the country?

Thanks.

You have to get the GPS or IP info and use a 3rd party tool to return to you (based in the GPS coordinates or IP number) what country is the user.

There are some 3rd party tools out there. One of them is geonames.org

@Renato - RBG thanks for the reply. I will check it out.

@twistmobileindia hm… I am actually not looking for an app, but I want to find out the location of my app being used.

There’s system.getPreference() function which can return language and country set in devices.

@piotrz55 thanks a lot. That is really what I want and fits my condition.

system.getPreference() will return the country that the user set in the device, not exactly his real position

Yes, I can understand. But system.getPreference() should serve my purpose. I just want to show different ads based on the country. 

By using GPS to do this, I think it becomes too complicated for this case.

@Renato
If I have understood joe528 well, he just wanted raw estimate of user position as country. Of course, it can be manipulated but usually you can assume user have it set correctly if you do not need to be 100% sure

You have to get the GPS or IP info and use a 3rd party tool to return to you (based in the GPS coordinates or IP number) what country is the user.

There are some 3rd party tools out there. One of them is geonames.org

@Renato - RBG thanks for the reply. I will check it out.

@twistmobileindia hm… I am actually not looking for an app, but I want to find out the location of my app being used.

There’s system.getPreference() function which can return language and country set in devices.

@piotrz55 thanks a lot. That is really what I want and fits my condition.

system.getPreference() will return the country that the user set in the device, not exactly his real position

Yes, I can understand. But system.getPreference() should serve my purpose. I just want to show different ads based on the country. 

By using GPS to do this, I think it becomes too complicated for this case.

@Renato
If I have understood joe528 well, he just wanted raw estimate of user position as country. Of course, it can be manipulated but usually you can assume user have it set correctly if you do not need to be 100% sure