Scott B
Scott B

Reputation: 41

android google drive sdk and dropbox sdk

I'm working on file manager application for android. I use dropbox and google drive sdk. I want to implement some kind of Factory of cloud storage. eg if user selects google drive I'd create GoogleDriveClient whic inplements MyClient interface and use it. if user selects DropBox I'd create DropBoxClient which implements MyClient interface and use it. But there is a problem that I need activity in this client, because of sdk.. please provide your thoughts how can i make some abstraction of my cloud clients. Thank you.

Upvotes: 2

Views: 140

Answers (2)

csenga
csenga

Reputation: 4114

As far as i know both of them are using OAuth 2.0 for verification and identification. As you said, both of them require to call their activitys, but ONLY for the FIRST time. Once the user allowed your application to access the desired service, you can get and save their tokens. After you have the token, you can login with it and do your task, without calling any 3rd party's Activity.
Refs: Dropbox Drive

Upvotes: 0

Tmm
Tmm

Reputation: 187

That's right. Once you got the token you should be fine, at least for Dropbox. I think the Google Drive tokens have limited lifetimes. You need to use the refresh token which was returened together with your access token. By the way, you can use the cloudrail SDK to add both services via one API. Should be much easier.

Upvotes: 2

Related Questions