Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
IOException thrown by AccountManagerFuture.getResult s whereas connection is alive
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Julien Martin  
View profile  
 More options May 27 2012, 7:52 am
From: Julien Martin <bal...@gmail.com>
Date: Sun, 27 May 2012 13:52:47 +0200
Local: Sun, May 27 2012 7:52 am
Subject: IOException thrown by AccountManagerFuture.getResults whereas connection is alive

Hello,

The following method systematically throws a IOException when invoked on my
Android device whereas the internet connection is alive (I can retrieve
emails or connect to gmail using my Android device).

Can anyone please help?

private void performAuthentication() {
    Log.d("GAWidget", "performAuthentication");
    GoogleCredential credential = new GoogleCredential();
    GoogleAccountManager accountManager = new GoogleAccountManager(this);
    Log.d("GAWidget", "after getting accountManager");
    Account account = accountManager.getAccountByName("bal...@gmail.com");
    Log.d("GAWidget", "after getting account"+"account.name: "+account.name);
    accountManager.getAccountManager().getAuthToken(account,
"oauth2:https://www.googleapis.com/auth/‌​analytics.readonly",
            true, new AccountManagerCallback<Bundle>() {

                public void run(AccountManagerFuture<Bundle> future) {
                    try {
                        String token = future.getResult(15,
TimeUnit.SECONDS).getString(AccountManager.KEY_AUTHTOKEN);
                        Log.d("GAWidget", "token: "+token);
                        useToken(token);
                    } catch (OperationCanceledException e) {
                        Log.e("GAWidget", "OperationCanceledException", e);
                    } catch (AuthenticatorException e) {
                        Log.e("GAWidget", "AuthenticatorException", e);
                    } catch (IOException e) {
                        Log.e("GAWidget", "IOException", e);
                    }
                }

            }, null);

}

Regards,
J.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julien Martin  
View profile  
 More options May 27 2012, 2:46 pm
From: Julien Martin <bal...@gmail.com>
Date: Sun, 27 May 2012 20:46:39 +0200
Local: Sun, May 27 2012 2:46 pm
Subject: Re: IOException thrown by AccountManagerFuture.getResults whereas connection is alive

I forgot to include the full stack trace:

05-27 19:09:04.319: E/GAWidget(12487): IOException
05-27 19:09:04.319: E/GAWidget(12487): java.io.IOException
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.AccountManager.convertErrorToException(AccountManager.java :1440)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.AccountManager.access$400(AccountManager.java:138)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.jav a:1301)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerRes ponse.java:69)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.os.Binder.execTransact(Binder.java:320)
05-27 19:09:04.319: E/GAWidget(12487):     at
dalvik.system.NativeStart.run(Native Method)

2012/5/27 Julien Martin <bal...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julien Martin  
View profile   Translate to Translated (View Original)
 More options May 28 2012, 9:14 am
From: Julien Martin <bal...@gmail.com>
Date: Mon, 28 May 2012 15:14:01 +0200
Local: Mon, May 28 2012 9:14 am
Subject: [android-developers] IOException thrown by AccountManagerFuture.getResults whereas connection is alive

Hello,

The following method systematically throws a IOException when invoked on my
Android device whereas the internet connection is alive (I can retrieve
emails or connect to gmail using my Android device).

Can anyone please help?

private void performAuthentication() {

    Log.d("GAWidget", "performAuthentication");

    GoogleCredential credential = new GoogleCredential();

    GoogleAccountManager accountManager = new GoogleAccountManager(this);

    Log.d("GAWidget", "after getting accountManager");

    Account account = accountManager.getAccountByName("bal...@gmail.com");

    Log.d("GAWidget", "after getting account"+"account.name: "+account.name);

    accountManager.getAccountManager().getAuthToken(account,
"oauth2:https://www.googleapis.com/auth/‌​analytics.readonly",

            true, new AccountManagerCallback<Bundle>() {

                public void run(AccountManagerFuture<Bundle> future) {

                    try {
                        String token = future.getResult(15,
TimeUnit.SECONDS).getString(AccountManager.KEY_AUTHTOKEN);

                        Log.d("GAWidget", "token: "+token);

                        useToken(token);
                    } catch (OperationCanceledException e) {

                        Log.e("GAWidget", "OperationCanceledException", e);

                    } catch (AuthenticatorException e) {

                        Log.e("GAWidget", "AuthenticatorException", e);

                    } catch (IOException e) {

                        Log.e("GAWidget", "IOException", e);

                    }
                }

            }, null);

}

Stack trace included:
05-27 19:09:04.319: E/GAWidget(12487): IOException
05-27 19:09:04.319: E/GAWidget(12487): java.io.IOException
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.AccountManager.convertErrorToException(AccountManager.java :1440)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.AccountManager.access$400(AccountManager.java:138)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.jav a:1301)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerRes ponse.java:69)
05-27 19:09:04.319: E/GAWidget(12487):     at
android.os.Binder.execTransact(Binder.java:320)
05-27 19:09:04.319: E/GAWidget(12487):     at
dalvik.system.NativeStart.run(Native Method)

Regards,
J.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sandeep Dhameshia  
View profile   Translate to Translated (View Original)
 More options Jun 21 2012, 2:20 pm
From: Sandeep Dhameshia <sandeep.dhames...@gmail.com>
Date: Thu, 21 Jun 2012 11:20:59 -0700 (PDT)
Local: Thurs, Jun 21 2012 2:20 pm
Subject: Re: [android-developers] IOException thrown by AccountManagerFuture.getResults whereas connection is alive

am also facing same issue. did you find any solution?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Julien Martin  
View profile  
 More options Oct 3 2012, 9:47 am
From: Julien Martin <bal...@gmail.com>
Date: Wed, 3 Oct 2012 15:44:23 +0200
Local: Wed, Oct 3 2012 9:44 am
Subject: Re: [android-developers] IOException thrown by AccountManagerFuture.getResults whereas connection is alive

Sorry for this late reply. No unfortunately I haven't found any solution.
Regards,
J.

2012/6/21 Sandeep Dhameshia <sandeep.dhames...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »