Android 根据邮政编码自动检测城市、州
我有一个用户需要填写的表格,在触摸屏键盘上有点耗时,所以我想根据一些用户输入(例如邮政编码)“自动完成”建议,
而不是用户输入他们的地址,城市,州,邮政编码
用户可以输入地址、邮政编码并获取城市和州的自动填充建议。
如果它们不正确,他们可以对其进行编辑,但很多时候它足够正确,尤其是对于州而言。
在 Android 中如何以最小的应用程序占用空间来完成此操作?我已经看到谷歌有某种地理编码API,但我不确定它是否与android相关
任何见解都值得赞赏
I have a form that users need to fill out, it is sort of time consuming on a touchscreen keyboard, so I want to "autocomplete" suggestions based on some user input such as zipcode
Instead of the user entering their Address, City, State, Zip Code
the user can instead enter Address, Zip Code and get auto filled suggestions for city and state.
They can then edit those if they are incorrect, but many times it will be correct enough, especially for state.
How would this be done in Android with the smallest app footprint. I've seen that google has some kind of geocode API but I'm not sure if it is relevant to android
Any insight appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于最小的应用程序占用空间,如果您不对用户所在位置做出任何假设,则需要使用某种 Web 服务来获取此信息。粗略的谷歌搜索显示这个作为示例。
如果出于某种原因,您只希望来自较小地理区域(例如在一个城市周围)的用户使用您的应用程序,则内置数据库/查找文件是可行的,但不适用于覆盖整个县。
For the smallest app footprint, if you make no assumptions about where the user is you'll need to use some sort of web service to get this. A cursory googling reveals this as an example.
If for some reason you only expect users from a small geographic area (like just around a single city) to be using your app, a baked in database/lookup file would be feasible, but not for covering the whole county.
对于我们的网络应用程序,我们使用 zipcodeapi/com/examples:
//]]>
邮政编码距离
For our web app, we use zipcodeapi/com/examples:
//]]>
Zip Code Distance