Android Question Dropbox is Deprecating Sync API

Mahares

Expert
Licensed User
Longtime User
I have received an email from Dropbox team stating that they are deprecating Sync API. Here is the link to the news:
https://blogs.dropbox.com/developers/2015/04/deprecating-the-sync-and-datastore-apis/#disqus_thread
Can anybody who masters Dropbox explain exactly what that means to some of us who developed B4A applications using the Sync API:
1. if our current applications will eventually cease to work in time.
2. Will we still be able to continue developing for Dropbox or we need to start looking for alternatives..
I am utterly confused.
Thank you
 

DonManfred

Expert
Licensed User
Longtime User
1. if our current applications will eventually cease to work in time.
Yes, if your app dont get updated skd (using a wrapper for core sdk)
2. Will we still be able to continue developing for Dropbox or we need to start looking for alternatives..
We still able. No need for alternatives.

As of now there are different APIs. Some are only for mobile platforms. Some are already using the core v1 api.
Sync- and Datastore-APIs will end of april 2016. Till this date Dropbox encourages us to update the SDK used changing to use the new upcoming core sdk v2 which will be relesed in the next 6 months. Core v2 will have support to sync and datastores i believe...

So we need to switch to use another SDK in future but we CAN continue to develop with Dropbox

See V2-Preview too.

As far as i can say the following seems the base-statement of the new v2 API

"Use whatever you want! It’s just HTTP."

There are three categories of endpoints.

  • RPC-style: The request and response bodies are both JSON.
  • Upload-style: The request has JSON in the Dropbox-API-Arg header and bulk binary data in the body. The response body is JSON.
  • Download-style: The request uses the GET method and has JSON in the Dropbox-API-Arg header and nothing in the body. The response has JSON in the Dropbox-API-Result header and bulk binary data in the body.
So we are able to upload files, download files, list folder contents, get metadata from file
just by using http. So, developing an app using Dropbox can be made by using just httputils2
 
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
So we are able to upload files, download files, list folder contents, get metadata from file
just by using http. So, developing an app using Dropbox can be made by using just httputils2
Thank you Manfred as usual for tackling the most difficult of questions. Can someone please address the following scenario:
I link to DropBox via an app with a secret and a key generated from a Dropbox app to simply upload files and download files to a folder on my PC that syncs with Dropbox. How do you use Httputils2 to accomplish the same thing without having a fixed URL or a web site.
Thank you
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
to simply upload files and download files to a folder on my PC that syncs with Dropbox
The upload is - like i already said - just http. When the file is uploaded then the Dropbox Client running on your PC should automatically download(sync) the new file(s)

But i´ll have a try on this later or this weekend too... Maybe i can say more then
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
@Erel:
Since you are the architect of the Dropbox library, what are you going to do to help the thousands of us that have applications that use Dropbox lib to upload and download files. As Dropbox team announced, the Sync API will be deprecated in 11 months. Will we be flooded with irate people complaining that their applications stopped working or will the applications continue to work even after the Sync API is deprecated.
Thank you in advance.for a detailed explanation.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thank you Erel for being there for us when we really need you. I can't wait to see your new wrapper for the Dropbox Core API. In the meantime, I have been trying to use HttpUtils2 for days to upload text files from my device to Dropbox, but I cannot figure out what to use for Dropbox URL to send or receive files. Can we upload/download files from/to Dropbox using HttpUtils2 without the use of Sync API.
Thank you
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
but I cannot figure out what to use for Dropbox URL to send or receive files.
See V2-preview

files/upload
(upload-style)
Note that the upload file size is limited to 150 MB. New API endpoints for uploading larger files (in chunks) are coming soon.

Sample request:
curl -X POST https://api-content.dropbox.com/2-beta/files/upload \
--header "Authorization: Bearer <access-token>" \
--header "Content-Type: application/octet-stream" \
--header "Dropbox-API-Arg: {\"path\": \"/cupcake.png\", \"mode\": \"overwrite\"}"
--data-binary @local-file.png

Sample response:
200 OK
Content-Type: application/json
{
"name": "cupcake.png",
"metadata": {
"client_modified": "2015-03-26T21:31:57Z",
"server_modified": "2015-03-26T21:31:57Z",
"rev": "8e941b183490",
"size": 59704
}
}

files/download
(download-style)

Sample request:
curl -X GET https://api-content.dropbox.com/2-beta/files/download \
--header "Authorization: Bearer <access-token>" \
--header "Dropbox-API-Arg: {\"path\": \"/cupcake.png\"}"

Sample response:
200 OK
Dropbox-API-Result: {"name": "cupcake.png", "metadata": { ... } }
Content-Type: application/octet-stream

cupcake.png
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thank you @DonManfred for your quick response. I have looked at Dropbox V2 preview, but I have no idea or clue what it is all about. I also tried to understand your response in the previous post, but I have no idea or clue what your response is all about either.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
It is possible to interact with Dropbox just doing HTTP calls.
Thank you @TDS. I wish I can say your post helped me, but the problem remains: What URL to use, what authentication. If you had success uploading/downloading to/from Dropbox via HttpUtils2, can you please share a smidge with us.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Yes, one of my apps primarily uses Dropbox. I used Erel's tutorial to dropbox API V0 (deprecated now) and my own Dropbox authenticator library.
I dont understand why Erel put it in the 'Old libraries forum' making it unsearchable as it works perfectly fine (although i dont spend time to answer support questions).
You can see my app here which I havent updated in a long time.
It was written in B4A 1.82. The code looks ugly, no classes, spaghetti coding in the service. I can send it to you if you want, but I dont know if you will feel more lost after that.

I would wait for Dropbox API V2. It can easily be wrapped using B4A code, but the authentication part might once again need a java wrap (as i did before).
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I link to DropBox via an app with a secret and a key generated from a Dropbox app to simply upload files and download files to a folder on my PC that syncs with Dropbox. How do you use Httputils2 to accomplish the same thing without having a fixed URL or a web site.
If the files are not too big i got it working just with b4a, httputils2 (okhttp) and json

dropboxV20027.png


I have tried it to upload files with a length of
1mb
5mb
10mb
20mb
50mb
160mb
285mb

The last two did not work.. i got a timeout exception... The limit is 150mb i think...

To use greater files we need to use the chunked upload function of the api...

i´ve started to implement this too yesterday... But it´s not ready as yet. Please note that my implementation is using the V1 api as it is not yet explemented in the V2 api...

I created a small class which hold all the methods and raises events in the calling activity.

Have a look at it yourself

The example is using my STORAGE library to find my sdcardpath... You can just replace it with you own solution. The library is NOT needed by the dropbox class.
 

Attachments

  • DropboxV2Test.zip
    9.7 KB · Views: 423
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I have looked at Dropbox V2 preview, but I have no idea or clue what it is all about. I also tried to understand your response in the previous post, but I have no idea or clue what your response is all about either.
I´ve tried to understand it and made a small example within the last days. See my previous post :)
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
No. No need for a java-wrap. We can use just httputils2 to use the functionality. I really like the new previews of the Api V2 :)
The reason for the java wrap was to invoke either the Dropbox app or the web browser to do the authneticate.
Users were not comfortable entering their details in my app.
Using HttpUtils2 can this be solved?
 
Upvote 0
Top