0

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:

enter image description here

On iOS it looks like this:

enter image description here

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?

lelelo
  • 173
  • 2
  • 12
  • To the best of my knowledge each cloud storage service uses it's on API. There is no OS-level API that lets you support multiple cloud storage services, and certainly not file system support. You could write an abstraction layer that offers a common API for cloud storage, and then write modules for each cloud service that use that service's API internally, but support your common API. Then you could call that abstraction rather than each service's APIs. This is a pretty common object-oriented technique. – Duncan C Oct 23 '17 at 00:26
  • Did you check the Share service from the Charm Down library? See this [post](http://gluonhq.com/new-gluon-charm-services-part/) – José Pereda Oct 23 '17 at 07:27
  • No I will be looking into that. – lelelo Oct 23 '17 at 16:23
  • Yes it worked perfectly to save. I somehow missed that in the library. However is there some way to make retreival from these clouds possible aswell? Is there a FileChooser? Or am I missing something about "sharing", - that word implies there something more than only saving? – lelelo Oct 24 '17 at 00:03
  • Share is just one way, from your app to other apps. What you ask for is a different thing. For that you'll need some API or SDK, API keys, ... and it will depend on each provider. For this, have a look at this [framework](https://cloudrail.com/integrations/interfaces/CloudStorage). – José Pereda Oct 24 '17 at 13:20
  • Thanks,that framework might work. I also have two other solutions in mind. One of them is to launch the preffered cloud app from my own app. Then by using the RuntimeArgsService - I think the user can launch my own app and getting the file that way (as the particular file extension is set to be associated with my app). I will test to see if it works. The other alternative is if there is a path (like on desktop - to the dropbox folder for example). Then it would be simple to get the files from that path. I don´t think this kind of path exists on mobile though? – lelelo Oct 24 '17 at 15:57
  • Does Gluon support "share input". So that other apps (and File Manager on Android) can share to the gluon app? The opposite. – lelelo Oct 30 '17 at 14:02

1 Answers1

0

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.

lelelo
  • 173
  • 2
  • 12