googleworkspace / android-samples

Android samples for Google Workspace APIs
Apache License 2.0
636 stars 410 forks source link

How to use Google Drive API in Android application? #119

Closed subashdbc closed 5 years ago

subashdbc commented 5 years ago

Hi,

I have been searching for the right resources for syncing files with Google Drive by Drive API from the android application. As I can see so many links, from that many are deprecated and some are about to shut down by Google.

Can anyone please help me with this? I am new to this development. It would be great if someone who guide me in the right way to achieve this Google Drive sync from Android application.

rbstarbuck commented 5 years ago

The Drive Android API is deprecated and will be shut down in December. We're recommending clients access Drive via the REST API. We've posted a migration guide: https://developers.google.com/drive/android/deprecation

...as well as a sample app demonstrating the use of the REST API in an Android app: https://github.com/gsuitedevs/android-samples/tree/master/drive/deprecation

subashdbc commented 5 years ago

@rbstarbuck Exactly, I too found this sample, https://github.com/gsuitedevs/android-samples/tree/master/drive/deprecation but the only thing is that I don't find the jar files that are used in the classes EX:

import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;

FYI: I use Eclipse as the IDE. And I installed all the Google Play Services on Android SDK, but still couldn't find the jar files.

It would be great if you help us. Thanks

rbstarbuck commented 5 years ago

To access Google Play Services APIs you can add the google() repository in your root build.gradle, e.g.: https://github.com/gsuitedevs/android-samples/blob/master/drive/deprecation/build.gradle

Then you can specify individual libraries in the dependencies of your app's build.gradle, e.g.: https://github.com/gsuitedevs/android-samples/blob/master/drive/deprecation/app/build.gradle

subashdbc commented 5 years ago

@rbstarbuck thanks for the response. Is it possible to achieve this with the Cordova application? Or, we need to try some other possibility to achieve google drive integration on Cordova apps?

erickoledadevrel commented 5 years ago

Unfortunately we don't have any familiarity with the Cordova platform.

erickoledadevrel commented 5 years ago

You may want to ask your question to Stack Overflow, where there are a more diverse set of developers:

https://developers.google.com/drive/api/v3/support#questions_and_advice