简体   繁体   中英

How can I save and load to clouds like Dropbox, OneDrive and iCloud on Android/iOS with Gluon and javafx?

In my app I am looking to add the ability for my users to store data onto a cloud of their choosing. How could this be achieved in the best possible way? I am using Gluon Mobile which allows me to use JavaFX onto iOS and Android.

Most preferably I would like to use something like the operating system´s own file saving handling system. On my Android phone it looks like this:

在此处输入图片说明

On iOS it looks like this:

在此处输入图片说明

I have taken a look at Dropbox api for java and it has very good documentation on how to use their api: https://www.dropbox.com/developers-v1/core/start/java I cannot find the same help for using Onedrive and iCloud. This is also a clear unfavorouble way of achieving my goal of allowing my app user´s to save to their clouds. I hope to avoid to have to handle these api's.

How can I allow for my app users to store their data onto their clouds?

I solved this in a satisfactory way using Inter-App communication. You declare in ´AndroidManifest´ and ´Default-Info.plist´ respectivly what kind of file type your app support. And here there is no hinder for you to declare your own file type if you would like that. It is explained in the answer to this question here: Is it possible to launch app from URL and handle the URL content from inside app?

So you can save to clouds using ShareService , and load files via RuntimeArgsService with proper set up to AndroidManifest.xml and Defualt-Info.plist . However this might not be as user friendly as having internet connection to a possible database, so that you can provide a custom GUI inside your app to handle file loading and saving. The user will have to select files outside your app - to use them in your app, if you go with this approach . In my circumstance however this was the best option to go for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM