in google drive, there's a tab named "backups" that contains data from old android phones I have.
These backups are not downloadable.
Is there a way to download these backup files? is there a way to get the information inside the backup files? ( API requests )
I know that for the Whatsapp backup-file there is a different API (because it's not downloadable like the others).
There's no mention of accessing the backup folder in Drive API. But, if you're referring to a special folder called App Folder which is only accessible by your application, then you can. Check the Get authorization to use the App Folder.
Related
I tried following both the documentation:
https://developers.google.com/drive/android/pinning
And the demo:
https://github.com/googledrive/android-demos/blob/master/app/src/main/java/com/google/android/gms/drive/sample/demo/PinFileActivity.java
but I am still very confused on how to sync a pinned file between my local device and Google Drive.
According to the documentation:
Pinning a file causes the latest version of that file's contents and metadata to be downloaded to the local device whenever a new version is available.
I implemented the code provided, but they only show to set a file as "pinned" without more explanation.
When and where do we specify where those pinned files must be downloaded on the local device?
I created test files that are well listed in the remote Google Drive, but I have no idea how those pinned files can be retrieved automatically on the local device as explained in the guide.
The demos provided are just too simple and limited...
I actually succeeded to accomplish what I wanted, I had to understand how it worked through several tests.
In my app I actually use the specific app folder to interact with Google Drive:
Drive.DriveApi.getAppFolder(mGoogleApiClient)
This folder on Google Drive is accessed by the app only.
At first I thought I had to specify a folder on my device to indicate where the files from the Google Drive app folder should be downloaded but it does not work that way.
You just have to access this app folder directly and check if there were any changes inside it since the last time it was accessed.
So basically when the files were changed I copy them where I need in my app file structure.
i have developed a android app for farmers. it is a informative app for indian farmer.The users will be sending me the images and video files to me through my app. here i used (integrated) dropbox to receive those files directly to my dropbox space. whatever the image or video taken by the user, it will be stored on a folder in my mobile storage. Here what i want is, i want the folder in my mobile storage to be in sync with the folder in my dropbox.
How can i do this?
there is a app in market called Foldersync which exactly fulfil my requirement. how they are doing it? How can i keep a folder in my mobile storage and a folder in my dropbox to be in Sync?
Note :
i have gone through drop-box api and created a simple app to send files directly to my dropbox space and i know how to download a entire folder from dropbox.
But here my question is unique from that... pls don't answer the above points which i already know..
Please help!
Thank You
You can use the Dropbox API to keep a local client in sync with Dropbox. There are two main pieces to this:
1) Metadata:
Assuming you're using the Core API, the best way to get information about all of the file and folders in an account (or optionally under a specific path) is to use /delta:
https://www.dropbox.com/developers/core/docs#delta
With this, you can get information about everything your app can see, and then easily stay up to date with changes. There are some useful blog posts on using /delta here:
https://blogs.dropbox.com/developers/2013/12/efficiently-enumerating-dropbox-with-delta/
https://blogs.dropbox.com/developers/2013/12/filtering-dropbox-delta-results-by-path/
2) File content:
Using the metadata retrieved from #1, you can download any files you need access to locally using /files (GET):
https://www.dropbox.com/developers/core/docs#files-GET
You can upload locally changed files using /files_put:
https://www.dropbox.com/developers/core/docs#files_put
Or, for larger files, use chunked uploading:
https://www.dropbox.com/developers/core/docs#chunked-upload
https://www.dropbox.com/developers/core/docs#commit-chunked-upload
The main work here will involve programming the logic in your app to correctly receive changes from the server as well as upload local changes, in order to keep everything in sync.
Also, be aware that on mobile devices, bandwidth can be limited and/or expensive, so be careful to not accidentally automatically download a lot of data the user doesn't want or need.
My app is setup to allow backups to be saved to a Google Drive appdata folder. It all works perfectly well on the same device. When I make a backup, delete the app's data, then restore it all works.
However, when I try to backup on one device, then install on another and attempt to restore there are no files found. Same goes for when I uninstall the app on the original device, reinstall it on the same device and attempt to restore. Both cases result in no files being found despite the fact that I see there are files in the appdata folder when I log into Google Drive.
I read somewhere that you must use the RESOURCE_ID instead of the DRIVE_ID of a file for it to work between devices since a DRIVE_ID will be different from device to device. However the only way I've seen how to get the RESOURCE_ID is by using the driveId.getResourceId(), and I can't get the proper DRIVE_ID from another device.
tl;dr: how should I go about retrieving the proper file from the appdata folder that was created by another device/installation?
I have a database backup option in my app as well. I implemented it using the new Google Drive Android Api and what's more important, it works perfectly fine from one device to another.
Here's how I did it and what I recommend:
Before reading or writing anything to Google Drive, call requestSync to make sure everything is synchronized and up to date (see how to use it here).
Retrieve your files by name using a query instead of identifiers. As Google Drive allows multiple files with the same name, order your query by date and use the newest one.
To avoid creating multiple backup files with the same name, use a query to find if the backup file already exists on Google Drive and if it does, open it and overwrite it.
This is the point I guess you won't like: I recommend not using the Appfolder... for the moment. Google has acknowleged there might be some synchronization issues with it when uninstalling and reinstalling the app. I tried to use the Appfolder as well in my app without success and I finally ended up creating an ordinary folder in Google Drive. With that said, you can try the first three recommendations before adopting this one.
I hope these points can help with your implementation. If you need anything else, just tell.
I have an app on Android & iOS, say ABC. It stores and accesses SQLite database (.db file) which is local to user's device.
To provide sync among different devices, I implemented Dropbox Sync API so that data entered on one device gets reflected on other devices automatically. Of course, the user must have linked the app ABC to their Dropbox account on all devices. So, its the same Dropbox account on all devices.
The SQLite database gets stored in app folder (Dropbpx/Apps/ABC). I have taken permission for app folder only.
Now, I wish to implement multi-user feature with read/write permissions where users with different Dropbox accounts can access this app folder (Dropbpx/Apps/ABC). It seems app folders can't be shared. (When I try to share an app folder, it says 'An app folder can't be shared')
This link says you need Full Dropbox permissions to create a shared folder, but Sync API doesn't support Full Dropbox permission.
Any clues how can I provide multi-user feature (sharing a folder, .db files) with Sync API?
Any help would be appreciated.
The linked forum thread is still correct that the Sync API doesn't currently support the Full Dropbox permission. It's also correct that app folders are currently incompatible with shared folders (i.e., app folders can't be shared, or contain or be contained in shared folders.)
However, there is a new permission, called File Type, introduced after that thread, that the Sync API supports and can be used with shared folders. You can find more information about the different permissions here:
https://www.dropbox.com/developers/reference/devguide#app-permissions
Also, while .db isn't one of the standard extensions available in the File Type permission buckets, Dropbox API support can enable custom extensions as noted here:
https://www.dropbox.com/developers/support#custom-extensions
this is the first time I'm taking a look at the Dropbox API so I'm afraid I kinda don't understand much.
My purpose is to develop an App in which I place some files into a directory so as to be automatically uploaded to the server and synced in another device whose owner I'm sharing them with, so different accounts are being used of course.
In the end, it has to be something similar to Dropbox app itself: you are able to create a file, upload it and share it with some friends.
Any idea if this is possible, what to begin with, is it possible to use for this goal any folder i want or it has to be one particularly chosen by Dropbox...?
If you're asking for a way to programmatically share a folder with another user, the API doesn't currently support that. To do what you're doing, you would need to manually (with the Dropbox app or via dropbox.com) share a folder with the other user. From then on, you could use the Dropbox API to read from and write to that shared folder. (And the same would work from the other account, since the folder would be visible to both of you.)