简体   繁体   English

在没有GPS / WiFi /互联网的情况下获取用户的大概位置

[英]Get the user's approximate location without GPS / WiFi / Internet

I'm trying to find a way of checking if the user is in the US, and do it somehow that it's instant. 我正在尝试寻找一种检查用户是否在美国的方式,并以某种方式立即执行。 This means no GPS, and no internet. 这意味着没有GPS,也没有互联网。 I have a few ideas, but they're not as accurate as I'd want, so maybe someone here has some tricks up his/her sleeves. 我有一些想法,但它们并没有我想要的那么准确,所以也许有人在这里有些窍门。

Thanks! 谢谢!

I've just been looking at http://developer.android.com/guide/topics/resources/providing-resources.html and on table 2 there's some resource qualifiers for 'MCC and MNC' and 'Language and region'. 我一直在看http://developer.android.com/guide/topics/resources/providing-resources.html ,在表2上有一些“ MCC和MNC”以及“语言和区域”的资源限定符。

What about defining some resource, say a string indicating the country code, then setting up a different one for each country you are interested in. 定义一些资源,比如说一个指示国家代码的字符串,然后为您感兴趣的每个国家/地区设置一个不同的资源,该怎么办?

You could then look at the string to see what country you are in. I guess you'd need a bit of experimentation to see what works best, but it might work :-) 然后,您可以查看字符串以查看您所在的国家/地区。我想您需要进行一些试验才能确定哪种方法最有效,但它可能会起作用:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM