Dropbox sync api implementation for android application - android

how can I use sync api provided by dropbox to download songs and other files from dropbox to my device's sd card.
The documentation says that we should use DbxFileSystem.open(path); .
Has anyone implemented this api?

I posted the question to the dropbox forum and the reply was:
"Currently, it's not possible to choose the location where local cached data is stored on the Android Sync SDK. However, I'll make sure to pass this along to the team.".
Conclusion: We cannot download a file directly to the external storage.

Related

Download PDF from a URL in Downloads folder on android app with targetSdkVersion=30

I want to download a pdf from a url on Android>=11. My app is targeting android version 30.
I read that due to restrictions introduced from Android 11, it does not easily allow us to store files in external Downloads folder and we have to store it inside Android/package_name/[folder]/[file], but I want to store it in Downloads folder so that my user does not have to go inside Android/package/[Downloads]/[file] to view that file.
Also on devices which are running Android<11, I can download that file by simply using getExternalStorageDirectory right? Please provide me some clarity on this.
I found some answers previously but they weren't that helpful. Can anybody tell me how to achieve this?
In Android 10ff it is not easy to use the java class "File" to store data in a public accessable folder that is pre-defined by your app.(ie the public download folder)
Instead your app has to ask the app-user where he/she wants to store the document.

how can i keep a folder in my mobile storage and a folder in my dropbox space in Sync?

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.

how to sync a folder with drive using google drive android api? What is Transparent offline Sync?

I want to sync a folder with google drive. where it should check for local mobile sdcard folder files if they are not present in google drive it should upload such files to drive and vice versa based on time and date.
And in New Google Drive Android Api What is Transparent offline Sync ? any example code on that.
"Transparent offline sync" is referring to the fact that items that already exist in the user's drive may be available offline, and that if you create or modify files while offline, the changes will be sent up to the folder when they come online.
There isn't any code involved, it just happens in the background as you use the API.
No way to do a bi-directionnal synchronisation of a directory with google drive on android even using a simple call to the google drive API. You will have to use the timestamps of the file/directories AND to handle the deletion/creation, you will have to keep a trace of all the timestamps of all your file tree at a given time... If anyone could say I am wrong and explain me another way using the API (better) or configuring google drive (as you can do on a PC) I would be gratefull. Another idea is to use a clever android app such as FolderSync.

save files from android app to google drive without using HTTP request

I want to save files from my Android application to Google drive, but i don't want to use HTTPS request. I want to put my files in Google drive even if the user is offline like local drive. So when user will come online, Google drive will upload this file to cloud automatically.
Is there any api exist who let upload files while offline?
Is there any same APIs for iOS also??
Thanks,
There is no API to interact with the Google Drive Clients in the way that you want, sorry! However, it is as easy as doing a copy or move operation on the file system. Just ask and store the user's Google Drive location on the disk, then copy the file into that directory when you need to.
For people digging in the Stackoverflow archives, note that offline drive access is available using the Google Drive API for Android. See the documentation here: https://developers.google.com/drive/android/ ... and for sure there must be one for iOS too.

How to open local files from google docs

How to open local files which are stored in my android device local storage using google docs.
Use the Google Documents API to upload them, and then to open them.

Categories

Resources