0

Before I go too far and realize there was an easier way to do this, I have a simple question:

Situation: In an Android app, I have 200 hand-picked restaurants and I want to display the 20 closest to a user based on his location. There are multiple users and restaurants should be added dynamically. For this, I need a list of those restaurants. Logically, I should only return the 20 closest ones, in case it grows to 20000 one day. It only makes sense.

Question: Does google provide an API for me to store data that can be accessed from all users based on their own query string? Or do I have to store it in an external server and get the infos with JSON?

Just don't want to miss an available service that makes all of this easier.

Jack M.
  • 1,195
  • 13
  • 30
  • Just to understand: you're talking about several users on the single Android device or several users of your app? it's not clear – greywolf82 Jun 08 '14 at 16:02
  • Oh, on the app of course. Didn't even consider multiple users on the devices ;) – Jack M. Jun 08 '14 at 16:08
  • I know but it's possible today :) – greywolf82 Jun 08 '14 at 16:10
  • Yeah, restaurants are fine, but if I make it a BDSM club finder, I better allow the user to set a password to use the app because of what you said. – Jack M. Jun 08 '14 at 16:11
  • If your database is not local, the only way is to have a remote server. You can try to see Google cloud messaging but I think you have to use your JSON messages to get info. – greywolf82 Jun 08 '14 at 16:13
  • if you are sure you have 200 restaurants only and it is not going to expand dramatically like to 2000 then why dont you calculate the distance in the app itself. Its just some calculations Its only a suggestion though I thing google big query can be used also – Illegal Argument Jun 08 '14 at 16:13
  • @greywolf82 gcm sends bundle not jsonobject thats what I get in my app and the size limit is 4kb – Illegal Argument Jun 08 '14 at 16:14
  • See thats the kind of info I am looking for. Seems remote is the way to go. :) – Jack M. Jun 08 '14 at 16:15
  • @IllegalArgument I know but I never use it, indeed I suggested to use custom JSON messages – greywolf82 Jun 08 '14 at 16:15
  • @greywolf82 really and I was cracking my head over the bundles if possible please see my question here http://stackoverflow.com/questions/23905566/multiple-notification-from-gcm-not-directing-to-correct-activity I couldnot solve it so had to resort to really dirty mechanisms – Illegal Argument Jun 08 '14 at 16:21
  • @MrJack With the proper space partition algorithms you can do nearest neighbor searches in O(log(n)) so no problem even with 1mln of points if you want put all in-app – greywolf82 Jun 08 '14 at 16:26

0 Answers0