Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Develop
Test
Publish
Monetize
Engage users
Device specifications
Resources
Skip to main content
The A3L Authentication SDK supports integration with Google APIs. This integration can allow a user access to a Google service after they sign in to your app with their Google account. Currently, A3L Authentication supports Google Drive scopes. For details on Google Drive scopes, see Choose Google Drive API scopes in the Google developer documentation.

Integrate Google Drive

To integrate Google Drive with your Fire OS app, you must first integrate with the A3L Authentication SDK and implement the sign-in feature. For instructions, see Integrate A3L Authentication SDK. Add the Google Drive SDK as a dependency in your app’s build.gradle file, as shown here.
Use version v3-rev20220709-2.0.0 or later of google-api-services-drive. When you create the A3LSignInOptions object, request the appropriate scopes for Google Drive through the requestScopes() method, as shown in the following code.

Create credentials

After signing in the user, create credentials for Google Drive with an FOSAccountCredential object. When you create the object, pass the same scope that you passed for the A3LSignInOptions, as shown in the following example.
Use this credential in your Google Drive builder, as shown here.
Now you can use this Drive object with Google Drive API calls. The following code shows how to use the Drive object, and list the name and IDs of up to 10 files.

Class differences

The following table lists the differences between the available methods in GoogleAccountCredential and FOSAccountCredential classes.
APIAvailable in GoogleAccountCredentialAvailable in FOSAccountCredential
static usingAudience(Context context, String audience)YesNo
static usingOAuth2(Context context, Collection<String> scopes)YesYes
Constructor (Context context, String scope)YesYes
getAllAccounts()YesYes
Returns only the account that was used to sign in
getBackOff()YesYes
getContext()YesYes
getGoogleAccountManager()YesNo
getScope()YesYes
getSelectedAccount()YesYes
getSelectedAccountName()YesYes
getSleeper()YesYes
getToken()YesYes
initialize(HttpRequest request)YesYes
newChooseAccountIntent()YesNo
setBackOff(BackOff backOff)YesYes
setSelectedAccount(Account selectedAccount)YesYes
setSelectedAccountName(String accountName)YesYes
setSleeper(Sleeper sleeper)YesYes
Last modified on December 5, 2023