1. Are you ready for the Galaxy S20? Here is everything we know so far!

Find the user's zip code

Discussion in 'Android Development' started by wige, Dec 14, 2009.

  1. wige

    wige Newbie
    Thread Starter

    I am creating a new app that will allow users to search for local concerts. This app will pull data from a web database that uses a supplied zip code or state to determine the market area that should be searched.

    What is the best way to determine a user's current zip code? I can't seem to find much documentation on getting information from the user's network location - how to do it, what format it is in, ways to convert that to a zip code - all the samples seem to use the GPS, which is overkill for this app. Any suggestions?

    1. Download the Forums for Android™ app!


  2. mkhopper

    mkhopper Well-Known Member

    Sounds like a good idea for an app.

    Even the user's network location is stored as lat/long in the phone. It just isn't as precise.
    For a zipcode lookup though, it ought to be more than close enough.

    I couldn't find any easy way to do a web lookup that returns a zipcode based on lat/long, but I did find a free database in .csv format that gives this information.

    It's a few years old, but may serve as a start.

    Free Zip Code Latitude and Longitude Database

Share This Page