OneBusAway / onebusaway-android

The official Android app for OneBusAway
http://www.onebusaway.org/
Other
484 stars 295 forks source link

Cloud save for favorites/recent stops/routes #32

Open paulcwatts opened 12 years ago

paulcwatts commented 12 years ago

Reported by eric.hanchrow, Aug 11, 2012 I use the app on many devices, and have to enter my favorite stops on each. It'd be nice if I could save that list of stops so that it'd be available on every other Android device on which I was logged in, and using the app.

Comment 1 by cookieguru, Today (103 minutes ago) Dropbox or a similar service?

Comment 2 by eric.hanchrow, Today (101 minutes ago) Dropbox would be fine. But my Google account would be even better, since most users of one bus away will already have a Google account.

barbeau commented 10 years ago

Seems like Google Cloud Save in Google Play Game Services would be a good candidate here, since it also includes support for iOS and web. So, we could share favorites across platforms as well.

I'm interested in this to support saving favorites to Glass (https://github.com/OneBusAway/onebusaway-android/issues/116) as well, although currently Glass does not support Google Play Services, which is required for Cloud Save. Maybe Glass could use the web REST API instead?

paulpv commented 10 years ago

@barbeau FYI: I use Android's BackupManager on my [currently private] Glass app, but I haven't confirmed if it is actually backing up my settings to the cloud or not.

barbeau commented 10 years ago

@paulpv I guess BackupManager would work for a one-time bootstrap of user data on Glass, which would restore the users favorites, etc. when they install the Glass app from their most recent backup from an Android device. But, it seems like even if you treat Glass app as read-only (i.e., the user can't edit/add/remove items), you really shouldn't be using this to keep Glass up-to-date with ongoing changes from Android device - from Data Backup docs:

Note: The backup service is not designed for synchronizing application data with other clients or saving data that you'd like to access during the normal application lifecycle. You cannot read or write backup data on demand and cannot access it in any way other than through the APIs provided by the Backup Manager.

And, I'd prefer to allow the user to do simple things from Glass like tag new stops as favorites, etc. For this, and syncing changes across multiple devices/platforms, seems like Cloud Save or something similar is needed.

barbeau commented 8 years ago

Looks like Firebase Real-time database might be a good option for this - https://firebase.google.com/docs/database/.

barbeau commented 8 years ago

From https://firebase.google.com/pricing/ for "Realtime Database":

SPARK (free) plan:

  • Simultaneous connections = 100
  • GB stored = 1 GB
  • GB Transferred = 10 GB
  • Daily private backups = NO

FLAME ($25/month) plan:

  • Simultaneous connections = Unlimited*
  • GB stored = 2.5 GB
  • GB Transferred = 20 GB
  • Daily private backups = YES

For FLAME Unlimited connections:

*Firebase imposes hard limits on the number of connections to your app's database at the same time. These limits are in place to protect both Firebase and our users from abuse.

The free plan limit is 100, and cannot be raised. The Flame and Blaze Plans have an initial limit of 10,000 simultaneous database connections. This is to prevent abuse and can be raised by contacting Firebase support with 24 hours notice.

This limit isn't the same as the total number of users of your app, because your users don't all connect at once. We encourage you to monitor your peak simultaneous database connections and upgrade if needed.

We're working hard to remove the initial 10,000 simultaneous connection cap on the Flame and Blaze plans.

Without running any numbers, I'm guessing that for something simple like storing the combination of userId and favorite stopIds we'd be able to squeeze into the FLAME package for $25/month. Free tier wouldn't work due to limited number of simultaneous connections at 100.

barbeau commented 6 years ago

Looks like Cloud Firestore is replacing Firebase Realtime Database - see: https://firebase.google.com/docs/database/rtdb-vs-firestore