|
With sms-ie, I have setup my "Export to directory" to "My Documents" folder. This works as expected for all things that are exported by when providing the time each day for this to occur. My issue is how to get this to sync with a cloud resource, specifically Google Drive. From what I can tell, I would have to use a third-party tool like FolderSync to sync files from my android, esp in the case of Google Drive. At one time Google Drive could do specific folders for syncing but that feature was taken away. tmo1 believe there should be a way to do this without FolderSync since sms-ie does all input and output via the Android Storage Access Framework (SAF). I guess my expectation with this in mind in that when I click on "Export to directory", I would see other resources I can export to, like "Google Drive". But all I see are internal storage locations. Has anyone found a way to do this? Has anyone synced to a cloud resource? How did you setup your device so the cloud resource appears? |
Replies: 12 comments 7 replies
Accessing Google Drive via the SAF apparently requires the Google Drive app - see here. Do you have it installed? |
|
I don't know what to tell you. You can try other apps that use the SAF interface and see if they can see your Google Drive account. If they can, then perhaps I can troubleshoot further why SMS I/E can't, but if they can't, then the problem is with Google Drive or your account / configuration, and I can't troubleshoot that for you. |
|
I searched online and struggled trying to find a good answer. Then, I tried a different approach and searched on Google with "how to get android app to access google drive" and got this result in the first paragraph from the Google AI response. "To allow an Android app to access your Google Drive, you need to grant the app permission to access your Google account within the app settings; this usually involves a prompt within the app asking you to sign in with your Google account, which will then give the app the necessary permissions to read and write files on your Google Drive." On one of the links to the right associated to this AI result, I went to "Allow third-party apps for Drive files". https://support.google.com/a/answer/6105699?hl=en When I read this there was a blurb about "Allow users to access Google Drive with the Drive SDK API." I went ahead and looked up "Drive SDK API" at this link. https://developers.google.com/drive/api/guides/about-sdk The diagram on this page shows that through oAuth one can access Google Drive folders such as "My Drive" and other "Shared drives". Apparently, Android apps need to login to the cloud storage, and authorization needs to be provided for the app by the user to be able to access Google Drive. This is the best answer I found to why the app is not able to access Google Drive. This probably is out of the scope of your coding priorities and all of this doesn't mention SAF to any extent. So I think this is non-SAF approach which goes against your coding approach. I tried looking for a SAF app but I could not figure out what app was "exclusive" to SAF. Amaze app uses SAF but I don't know to what extent. I was able to get to Google Drive using the app within a certain context. There were Google Drive apps but that doesn't mean they use SAF exclusively. Anyway, when time allows, I'm going to keep searching and see if I can find another solution or an exclusive SAF app. |
Google apparently makes Drive accessible via a special API, which apps can use to access Drive directly, without going through the generic SAF framework.
My understanding is that in addition to its proprietary API, Drive should also be available via the generic SAF. I suggest you ask Google itself, or ask on a third-party Google forum, for help regarding this.
Correct. I'm sorry, but I'm not going to devote considerable time and effort to coding for Google's proprietary API where the SAF approach generally works fine.
You can try Material Files - I'm not sure, but I don't see any mention of Google Drive integration. |
|
Here's a question. In sms-ie, if I go to settings and click on "Export to directory:", I see this at the top. Material Files is completely different application, but it has a hamburger menu at the top left as shown below. If I click on the hamburger menu, I see this. From this top-level menu, I see "Drive" listed and I can go to it. Somehow this app is able to access it and sms-ie is not. I'm not sure if they are using SAF or not. I guess that is the magic question I need to ask them? I guess I'll ask them. |
Hm. There have been numerous requests for Material Files Google Drive integration: #95, #541, #619, #705, #715, #763, #925, #1070, #1304. I can't find where such support was added, but the comments in 95 as well as 619 suggest that @zhanghai was looking at implementing the Drive API. |
|
This is interesting. I didn't post everything I thought I did when the Google Drive appeared. What I did was go to "Internal Storage" and choose "Android/obb". Then I got this on my menu. From here, I clicked on "Android/obb" and the new navigation menu appears with Google Drive. Not sure what that is doing. No idea why obb has a connection to Drive?!? However, that is probably all Drive API logic as you mentioned and out of scope. It's very interesting how it can flip-flop from what appears to be a SAF navigation? to navigation menu with Drive API menu navigation. I'm not sure what the developer is doing. I did sent him an e-mail though. The interesting thing is that his webpage says he is a Staff Software Engineer at Google. Probably wasting your time with all this info but I do find it interesting. In the e-mail, I did point him to this post. He might surprise us with some insight. |
|
Here's an article about basic SAF implementation. I looked at the code in AndroidManifest.xml and it doesn't have
I think And the rest, I'm not sure where and how they should be implemented. I'm getting the impression SAF isn't fully implemented based on this article. But I'm not an Android developer so I'm not sure. I couldn't find references to some of his implementation in the code. However, maybe I didn't search right or maybe it's implemented differently than this article. Maybe someone can point me to where the SAF logic is implemented? |
It's unnecessary, since it's a transitive dependency of
As far as I know, SAF support is properly implemented. |
I tested using a Nextcloud account on my phone, and the Nextcloud account correctly shows up in the contexts of both manual operations ("buttons on the main page") as well as scheduled export (when selecting "Export to directory"). I don't know why Google Drive isn't showing up for you in the latter context. |
|
Apologies in advance for being unable to offer any insight into this, but just to add one more datapoint I'm experiencing the exact same issue attempting to export to proton drive. Doing a manual, one time export yields the file explorer with a hamburger menu that allows me to select Proton Drive, but trying to setup periodic backups only lets me select from my phone's internal storage. In case it's useful, I'm on a Pixel 6a running GrapheneOS. |
Your data point was the impetus for me to finally figure out what's going on here. When SMS I/E performs manual exports, it uses single-file API calls that are widely supported by cloud SAF providers, but when scheduling exports, the app needs a folder / directory into which it can repeatedly write export files, so it uses An effective if somewhat cumbersome solution is the one eventually adopted by SeedVault: use an Android rclone wrapper that makes cloud storage facilities available through the Android SAF (with [ |







Your data point was the impetus for me to finally figure out what's going on here. When SMS I/E performs manual exports, it uses single-file API calls that are widely supported by cloud SAF providers, but when scheduling exports, the app needs a folder / directory into which it can repeatedly write export files, so it uses
ACTION_OPEN_DOCUMENT_TREE, which many cloud SAF providers apparently do not support - including (rather surprisingly) Google Drive (see here, here, and here) and Proton Drive. Other Android…