开发者

Android: Retrieve Zip code from phone

开发者 https://www.devze.com 2023-03-10 05:24 出处:网络
I have a very basic question. I want to retrieve a zip code automatically from the phone. I have been do开发者_运维技巧ing research and I\'ve seen geocoder mentioned several times. But it seems overly

I have a very basic question. I want to retrieve a zip code automatically from the phone. I have been do开发者_运维技巧ing research and I've seen geocoder mentioned several times. But it seems overly complex for what I am trying to do and also that it returns a long/lat coordinate not a basic zip code.

My end game is basically to have a user press a button and the location will auto populate an edit text field or assign the value to a variable that I can use.

Please help!


I want to retrieve a zip code automatically from the phone.

There is nothing in Android -- or any other mobile OS that I am aware of -- that supports this. For starters, nobody has to provide a physical address to their Android devices.

I've seen geocoder mentioned several times. But it seems overly complex for what I am trying to do and also that it returns a long/lat coordinate not a basic zip code.

If you referring to Geocoder, it returns a physical address given a latitude and longitude.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号