Android: Retrieve Zip code from phone
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.
精彩评论