找到你要的答案

Q:Code an app to detect a specific location through input of zipcode?

Q:代码的应用程序通过输入邮政编码检测的具体位置?

I am trying to develop a component of an app in Android Studio where it allows the user to input their zip code and the app will automatically determine the city and state, instead of having the user type it all in. With this information the app will help connect other users of the app in the same location. I don't want a map to show like a gps. Just have the app be able to recognize the zip codes and specify where the user lives.

Ex: If user typed 90210 and the app would convert it and identify it as Beverly Hills, CA.

If someone could help on how to code this I would greatly appreciate it!

我试图开发一个组件的应用程序在Android Studio中,它允许用户输入他们的邮政编码和应用程序将自动确定城市和状态,而不是有用户类型。有了这个信息,该应用程序将有助于连接其他用户的应用程序在同一地点。我不想地图显示像一个全球定位系统。只要有应用程序能够识别邮政编码,并指定用户生活在哪里。

如果用户键入90210和应用程序将转换它,并确定它作为贝弗利山庄,CA.

如果有人可以帮助如何编码,我将不胜感激!

answer1: 回答1:

You can use google maps API to get the information you want.

For Example: http://maps.googleapis.com/maps/api/geocode/json?address=94087

Please refer to this page for more documentation: https://developers.google.com/maps/documentation/geocoding/intro

你可以使用谷歌地图API得到你想要的信息。

例如:http://maps.googleapis.com/maps/api/geocode/json?地址= 94087

请参考本页更多文档:https://developers.google.com/maps/documentation/geocoding/intro

android  android-activity  android-studio