Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8847627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:14:07+00:00 2026-06-14T12:14:07+00:00

I am trying to integrate my app with a Google API, say Google Tasks,

  • 0

I am trying to integrate my app with a Google API, say Google Tasks,

Before Google Play Services I would use the Google APIs Client Library for Java and the AccountManager to retrieve and access the OAUTH token for the API.

The pros of this methos is that I can:

  • Using the Java client APIs smoothly to access all the API methods my app may need.

the cons is that:

  • The Authentication Dialog is very bad looking and confusing to the user (As mentioned in Google IO Play services session)
  • I will need to add all kind of permissions to the app.

I guess ‘Google play services’ came to change all that:

  • No app permission is needed as its directly taken from the play services and then eventually from the user
  • It also offered the new beautiful AccountPicker that make authentication clearer to the user.

But the ease of access to the Java Client library API methods is lost!!! I have to create all the requests by myself.

The question is What is the best way to authenticate and request the OAUTH token using play services and after that continue to work with the Client library APIS to access the actual API methods?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:14:08+00:00Added an answer on June 14, 2026 at 12:14 pm

    You should be able to pass the result of GoogleAuthUtil.getToken (from Google Play Services) directly to GoogleCredential.setAccessToken (from the Google APIs Client Library).

    An example of the latter can be found in TasksSample.java. In fact, since the AccountManager.getAuthToken and GoogleAuthUtil.getToken APIs are so similar, save for the asynchronous vs. synchronous difference, you should be able to modify that Tasks sample to use Google Play Services without too much difficulty.

    Some very rough pseudocode would be:

    ...
    // this should all be in a separate thread (e.g. AsyncTask)
    final String token = GoogleAuthUtil.getToken(context, email, scope);
    GoogleCredential credential = new GoogleCredential();
    credential.setAccessToken(token);
    
    Tasks service = new Tasks.Builder(transport, jsonFactory, credential)
        .setApplicationName("Google-TasksAndroidSample/1.0")
        .setJsonHttpRequestInitializer(new GoogleKeyInitializer(ClientCredentials.KEY))
        .build();
    
    List<String> result = new ArrayList<String>();
    Tasks.TasksOperations.List listRequest = service.tasks().list("@default");
    listRequest.setFields("items/title");
    List<Task> tasks = listRequest.execute().getItems();
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use a JDO with Google App Engine and Scala. The api
So I am trying to integrate the facebook iOS api into my iphone app.
I'm trying to integrate a Flex app with Google Checkout and code that runs
I'm developing on the Google App Engine and I would like to integrate Facebook
I am trying to integrate my Rails app with a 3rd party API (Twilio).
I am trying to integrate a shipping API with my app. I send my
I am trying to integrate the code from this demo: http://code.google.com/p/gwt-spring-starter-app/ into my main
I am trying to integrate the PayPal MPL library into an iOS app. I
I have been trying to implement in app billing of google play to my
I'm trying to integrate the Google Data API into my application. I'm using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.