Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Google Drive synchronization #25

Open
angrybacon opened this issue Feb 28, 2017 · 43 comments
Open

Add support for Google Drive synchronization #25

angrybacon opened this issue Feb 28, 2017 · 43 comments
Milestone

Comments

@angrybacon
Copy link

angrybacon commented Feb 28, 2017

Let's keep #24 for Git-related discussion.

@guntamania
Copy link

Is there somebody struggling for this feature?
I am investigating Google Drive apis and this repository and would like to share ideas if somebody is working for this.

@c-okelly
Copy link

I would be interested in working on it as well! I don't think there is currently a timeline on it and I would very much like the feature!

@rafaelleru
Copy link

I'm interested in work on this, any help about where to start looking? I mean some classes or packages that can be candidates to modify

@nevenz
Copy link
Member

nevenz commented Mar 24, 2017

Service-side - new class is needed implementing Repo interface
UI-side - new fragment is needed to display directory/auth view

Those are tied together in ReposActivity and RepoFactory.

Checking existing DropboxRepo and DirectoryRepo is probably a good start.

(There's a lot of room to DRY things up, as this is all very similar. But I wouldn't worry about that right now if you're just starting - copying what DropboxRepo does and how is used is fine.)

@relan
Copy link

relan commented Mar 24, 2017

Note that com.google.android.gms:play-services-drive is proprietary software. If it becomes a mandatory dependency, Orgzly won't be updated on F-Droid.

@rafaelleru
Copy link

I will keep it in mind @relan and try to find a way to solve this problem.

@rafaelleru
Copy link

Also I like to try to add nextcloud/ownclud integration appart from google drive. What do you think?

@klapauciusisgreat
Copy link

@relan: isn't the dropbox integration proprietary as well ? Why is integration with drive separate ?

If the issue is that this uses a specific android API not available on F-droid, could the app not use the regular web API (https://developers.google.com/drive/v2/reference/) ? I haven't written any Android apps, so perhaps this is a naïve question, and the app would have to use the android API But my understanding is that the user would just have to go through a separate OAuth flow to connect via the web API.

@relan
Copy link

relan commented Jul 8, 2017

isn't the dropbox integration proprietary as well ?

Dropbox SDK is free software (MIT license), see https://github.com/dropbox/dropbox-sdk-java

Why is integration with drive separate ?

Well, because Google decided to make com.google.android.gms:play-services-drive library non-free.

Can't answer your other questions, I never reasearched Google's APIs.

@groks
Copy link

groks commented Aug 19, 2017

Orgzly could use the Storage Access Framework (since Android 4.4) client API. Any SAF provider - such as Google Drive, Dropbox, OwnCloud #28, SD Card etc. - would then be available through one common interface.

@gaborbit
Copy link

+1 Google Drive, NextCloud

@stuart12
Copy link

Please add support for the Storage Access Framework so that we can sync to Nextcloud. Nextcloud now has an end-to-end encryption as an App so we get client side encrypted sync for free. At the moment I cannot sync to Nextcloud at all.

@nevenz
Copy link
Member

nevenz commented Apr 24, 2018

Orgzly could use the Storage Access Framework (since Android 4.4) client API. Any SAF provider - such as Google Drive, Dropbox, OwnCloud #28, SD Card etc. - would then be available through one common interface.

It already does - Orgzly uses ACTION_OPEN_DOCUMENT_TREE for "Directory" repo type. It's what opens the system browser.

However, support for that intent doesn't seem to be too popular with the providers. See for example nextcloud/android#303. Google Drive and Dropbox don't support it either.

@nevenz nevenz added this to the v1.7 milestone Apr 24, 2018
@rroblak
Copy link

rroblak commented Apr 24, 2018

It doesn't look like Orgzly accepts donations, but if I could I would donate to have this feature added. It's one of the last remaining obstacles to me switching to org-mode completely. Alas, I don't currently have time to work on it.

@ewilderj
Copy link

+1 would definitely pay/contribute.

@Ekleog
Copy link

Ekleog commented Nov 7, 2018

I think something that Orgzly could add would be repositories limited to a single file? This way it could use the same intent as the one for “Import Org file”, which does work with all providers.

Actually, it'd also match better my personal use case of org-mode files, where I'd like orgzly to show me only some of the notebooks in a directory, but that's an unrelated question :)

@Ekleog
Copy link

Ekleog commented Nov 7, 2018

As for donating money, I think BountySource (even though I don't like the idea of giving 10% of the donation to a for-profit intermediary myself) could handle this with a proof of the actual will to donate, better than someone just sending here a message saying one would donate :)

@credmp
Copy link

credmp commented Sep 19, 2019

Seeing that this issue was updated back in 2018 I am wondering if it should not be pushed to a later milestone.The inclusion of WebDav (#38) will make a lot of people, including me, very happy.

@nevenz
Copy link
Member

nevenz commented Sep 19, 2019

Seeing that this issue was updated back in 2018 I am wondering if it should not be pushed to a later milestone.

It makes sense. I planned to implement it in a separate module (moving Dropbox sync to the one as well), but that will take some time to figure out.

@nevenz nevenz modified the milestones: v1.8, v1.9 Sep 19, 2019
@Trevoke
Copy link

Trevoke commented Mar 1, 2020

With Dropbox's new approach of "only three devices can be linked" for the basic account, this is becoming more important for me.
In the meanwhile, I'm exploring what it would mean to set up a webDAV server somewhere for myself instead...

@credmp
Copy link

credmp commented Mar 2, 2020

I have been using webdav in 1.8.2 for quite some time already, it works like a charm.

@relan
Copy link

relan commented Mar 3, 2020

I'm exploring what it would mean to set up a webDAV server somewhere for myself instead...

There are a plenty of WebDAV providers, you don't necessarily have to run your own server.

@geraldofada
Copy link

Bump to this request. For me, personally, It's a must have.

@komali2
Copy link

komali2 commented Jul 27, 2020

I have some spare time and am a developer, is anyone working on this? If not I'm going to start. If yes let me know how I can help.

@komali2
Copy link

komali2 commented Aug 7, 2020

I'm working on this now so if you wanna know sup hit the email on my profile

@komali2
Copy link

komali2 commented Aug 7, 2020

fyi i have no fucking idea what i'm doing so nobody get your hopes up

@Trevoke
Copy link

Trevoke commented Aug 8, 2020

@komali2 I'd suggest you start using this issue to drop your resources and questions!

Ironically, I've now set up a nextcloud server for myself, but I'm still interested, and I'd be happy to help / provide insight / be a sounding board / etc.

I also don't know what I'm doing but I've never let that stop me before :p

@klapauciusisgreat
Copy link

klapauciusisgreat commented Aug 8, 2020 via email

@Trevoke
Copy link

Trevoke commented Aug 8, 2020

I think one option might require some painfully manual setup, such as this setup for calfw: https://github.com/myuhe/org-gcal.el

Basically you would create your own project on GCP to which you can give restricted permissions (only read/write gdrive?) and get a token you can use for authentication through that project

@komali2
Copy link

komali2 commented Aug 12, 2020

Orgzly could use the Storage Access Framework (since Android 4.4) client API. Any SAF provider - such as Google Drive, Dropbox, OwnCloud #28, SD Card etc. - would then be available through one common interface.

It already does - Orgzly uses ACTION_OPEN_DOCUMENT_TREE for "Directory" repo type. It's what opens the system browser.

However, support for that intent doesn't seem to be too popular with the providers. See for example nextcloud/android#303. Google Drive and Dropbox don't support it either.

But why then does the Storage Access Framework docs say this?:

The SAF includes the following:
Document provider—A content provider that allows a storage service (such as Google Drive) to reveal the files it manages

https://developer.android.com/guide/topics/providers/document-provider

Genuinely curious. This app is literally the first APK I've run on an android emulator on any machine ever so like, I'm totally out of my league here.

@komali2
Copy link

komali2 commented Aug 12, 2020

FYI lots of information towards the bottom of this page: https://developers.google.com/drive/android/deprecation

@komali2
Copy link

komali2 commented Aug 12, 2020

Also FYI it appears we can include the Drive API (not the REST API), as the license appears to be Apache 2.0 https://mvnrepository.com/artifact/com.google.apis/google-api-services-drive

@komali2
Copy link

komali2 commented Aug 12, 2020

Is there some kind of version mis-match going on between what I've got forked and what I've got off the app store? I have the option for "Dropbox" on my phone, but when I run the master branch locally, the emulator shows a slightly different UI, and no option for Dropbox:
Screenshot from 2020-08-11 18-31-24

@localredhead
Copy link

I've moved everything over to gDrive on my chrome OS devices - I want to be able to sync this with gDrive on my tablet.

+1 please.

@komali2
Copy link

komali2 commented Aug 18, 2020

I can't account for the significant design differences, but it appears if a dropbox account isn't "linked", that button won't show. I'm pressing on!!!

                    <Button
                        android:id="@+id/activity_repos_dropbox"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:layout_marginBottom="16dp"
                        android:drawableTop="?attr/oic_dropbox_not_linked"
                        android:text="@string/dropbox" />

@komali2
Copy link

komali2 commented Aug 18, 2020

Yoooo what's this, someone tried to support Git as a repo???

                    <Button
                        android:id="@+id/activity_repos_git"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:layout_marginBottom="16dp"
                        android:drawableTop="?attr/oic_git_48dp"
                        android:text="@string/git" />

@Trevoke
Copy link

Trevoke commented Aug 18, 2020

@komali2 I, for one, would like to thank you for putting in all the things you discover here. It's really entertaining, and it provides a ton of context for other folks who might want to come in and help!

@localredhead
Copy link

I can't account for the significant design differences, but it appears if a dropbox account isn't "linked", that button won't show. I'm pressing on!!!

Not sure it helps but I noticed this on the orgzly FAQ, saying that the dropbox sync doesn't show if you're an Fdroid user vs play store user. http://www.orgzly.com/help#f695589

@komali2
Copy link

komali2 commented Aug 20, 2020

I can't account for the significant design differences, but it appears if a dropbox account isn't "linked", that button won't show. I'm pressing on!!!

Not sure it helps but I noticed this on the orgzly FAQ, saying that the dropbox sync doesn't show if you're an Fdroid user vs play store user. http://www.orgzly.com/help#f695589

Oh wow, interesting.... I wonder if that's in the code, or a different version? Looking through the branches I don't see anything obvious, and I haven't learned enough about oic_dropbox_not_linked to know if it's in the code. But this is very helpful, thank you!

@nevenz
Copy link
Member

nevenz commented Aug 27, 2020

@komali2 Accessing Dropbox is under IS_DROPBOX_ENABLED, which is set to false for fdroid flavor (in app/build.gradle).

This is something that needs to be done for Google Drive too. I was planning to extract Dropbox (and other repo type implementations) to a separate module to exclude that code completely, but that's much more work, as it would require first extracting common interfaces to a module too, etc. So I think a new IS_GOOGLE_DRIVE_ENABLED is fine for now.

As for Git implementation, there were few PRs merged (and currently pending #643), but the whole thing it's under IS_GIT_ENABLED which is false by default, as it's not ready yet.

@ngharrison
Copy link

ngharrison commented May 28, 2021

I've put some work into making this integration, and I currently have authentication working. I've gotten kind of stuck trying to make it function like a dropbox repo does. I haven't found a way to pick a google drive file or folder by a path instead of an ID. If anyone is experienced with using the Google Drive API in Java, help is welcome.

I don't have a lot of time to put into this, so I can't guarantee when/if I get it done.

@ngharrison
Copy link

I've worked through the past obstacles and have code that accomplishes all the needed functions with Google Drive. I'm still having troubles with it working within the Android app.

I've created a pull request (#867) that you can follow the development on. @nevenz or others, any expert help is appreciated.

@codemac
Copy link

codemac commented Apr 6, 2024

Any thoughts from @nevenz about asking users to set up their own API key? Rather than shipping with one and needing the security audit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests