Store Realm files in Google Drive App Folder?

一世执手 提交于 2019-12-11 00:25:52

问题


I am in the early stages of an Android project that will be using a database, hopefully Realm. I want users to be able to access the same database from multiple Android devices (logged in to the same Google account). I am considering placing the Realm files in the Google Drive App folder.

I've done some searching, but have found no discussions of this particular configuration.

I have no prior experience with either Realm or the Google Drive API, so I'm concerned that there may be some fatal flaw(s) with this approach.

Any insights/advice appreciated.


回答1:


Edit: Since I answered this question, Realm launched the Realm Mobile Platform, which is precisely intended for doing this kind of job: Sync an application using a Realm database as the question describes. My previous answer is now obsolete.


Previous answer: Right now isn't possible to synchronize Realms through devices and keep the app "up to date" everywhere.

There is a similar question in the Github Issues in Realm: How to synchronize Realm data across multiple iOS/Android devices?

From one of the Realm's maintainers:

Since Realm supports JSON importing, interacting with a Web API is probably the best way to synchronize data between devices. See Realm's Rest APIs docs.

However this is a feature they're working on. You can track the realm-cocoa Issue #913 expecting changes in this way.

So, I agree with the comments I cited previously and recommend you to sync your applications using the API.



来源:https://stackoverflow.com/questions/34665259/store-realm-files-in-google-drive-app-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!