访问数据,以显示在Android应用程序搜索结果 [英] Accessing data to display as search results in Android app

查看:112
本文介绍了访问数据,以显示在Android应用程序搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Android应用程序这需要用户的当前位置,并显示接近他/她的位置的餐馆列表。餐厅'的数据提供给我(即我确实有纬度/经度每家餐馆我想在搜索结果中显示的)。我不能使用谷歌Places API的,因为我需要只显示在我们的数据库中提供(在我们的网站)的餐厅。我的问题是我如何访问我的数据库(甚至是URL),这是一台计算机上,提炼出餐馆数据,并显示在我的Andr​​oid应用程序搜索结果?结果
我其实制作无缝( http://bit.ly/Jp7pUN )为我公司类型的应用程序。
我是一个完整的新手到Android应用程序开发。所以,原谅我,如果这真的是一个非常广泛的或愚蠢的问题。请告诉我我需要学习来实现这个什么样的话题。我会学习,做我自己。

I am developing an Android app which takes the current location of the user and displays a list of restaurants close to his/her location. The restaurants' data is available to me (i.e I do have the lat/long of each restaurant I want to display in the search results). I can't use Google Places API, because I need to show only those restaurants that are available in our database(in our website). My question is how do I access my database(or even an URL),which is on a computer, to extract the restaurants' data and display as search results in my android app?
I am actually making a Seamless ( http://bit.ly/Jp7pUN ) type application for my company. I am a complete newbie to android app development. So, pardon me if this is really a very broad or a stupid question. Please just tell me what topics I need to study to implement this. I would study and do it myself.

感谢。

推荐答案

您将需要:


  • SQLite数据库以保存餐馆和他们的经度/纬度

  • 图形页面,以显示在地图(不要忘记注册您的谷歌地图的 API密钥

  • 地图覆盖,以显示地图上的标记

  • GPS访问,以获取用户的位置(需要相应的 Android的许可

  • 一个简单的搜索算法检索用户位置的x距离内的结果集的餐馆

  • a Sqlite database to store the restaurants and their longitude/latitude
  • a MapView to display the map (Don't forget to register your Google Maps API key)
  • a map overlay to show the markers on the map
  • GPS access to get the user's location (needs the appropriate Android permission)
  • a simple search algorithm that retrieves a result set of restaurants within x distance of the user's location

修改

如果您的数据库存储在服务器上,你需要一种方法来查询服务器,preferably使用基于HTTP的协议,如 REST 。它是有用的(但不要求)的缓存在Android设备上的餐厅位置(使用SQLite),如果用户离线(好消息:因为你既可以在Android和使用Java的服务器,90%的数据访问层,你将只需要编写一次)。

If your database is stored on a server, you will need a way to query the server, preferably using an HTTP-based protocol such as REST. It is useful (but not required) to cache the restaurant locations on the Android device (using Sqlite), in case the user is offline (The good news: Since you can use Java both on Android and the server, 90% of your data access layer you will only need to write once).

有关从服务器中的数据传输到Android客户端, JSON 是一个流行的格式。

For the data transfer from server to the Android client, JSON is a popular format.

这篇关于访问数据,以显示在Android应用程序搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆