Android Question Country access

ViNaTa

Member
Hello i need a code to check the country and if not my selected country app say message and log out.
That can check with sim card or ip or another things if you know pls help me?
 

Mark Read

Well-Known Member
Licensed User
Longtime User
Last edited:
Upvote 0

emexes

Expert
Licensed User
Hello i need a code to check the country and if not my selected country app say message and log out.
That can check with sim card or ip or another things if you know pls help me?
What about cases where people live near and regularly cross borders? Or international travellers? Or that Hawaii is part of USA but 4,000 km distant? Or Falkland Islands?

Is the issue that you need to know, say, which side of the road people drive on, or whether they are north or south of the equator, or which continent they're on, or which laws apply in the current location, or what language is most common, or... ?
 
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User

Exactly. Depending on the reason for this restriction, there are several more or less suitable options.

There are many differences to be aware of:

Perhaps there is code in the app that may not be available to users in some countries? What about tourists who may be legally allowed to use this code in that country, provided import and export regulations do not prevent it?
Or the software contains parts of code whose use is generally not permitted in this country?
From this point of view, you have to know exactly which method to use to achieve these restrictions.

There are several possibilities:

- Query the set language of the smartphone
- Query of the location via the location provider or GPS
- Query of the provider information, which also provides information about the country in which you are located.
- and not forgetting the possibility of perhaps only offering this app in certain countries via the Google Playstore.

All of them are more or less accurate, but it probably makes sense to use a combination of different methods.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…