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 7981163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:17:23+00:00 2026-06-04T10:17:23+00:00

I have implemented Twitter4J in my Android application and it’s works fine. But after

  • 0

I have implemented Twitter4J in my Android application and it’s works fine.
But after I login with twitter login page, it ask user to enter PIN code manually.

In Twitter4J class there is a method to retrieve and store(into sharedpreferences) the OAuth and oauth_token_secret.

/**
* Retrieve the oauth_verifier, and store the oauth and oauth_token_secret 
* for future API calls.
*/
@Override
protected Void doInBackground(Uri...params) {
        final Uri uri = params[0];
        final String oauth_verifier = uri.getQueryParameter(OAuth.OAUTH_VERIFIER);

        try {
            provider.retrieveAccessToken(consumer, oauth_verifier);

            final Editor edit = prefs.edit();
                    edit.putString(OAuth.OAUTH_TOKEN, consumer.getToken());
                    edit.putString(OAuth.OAUTH_TOKEN_SECRET, consumer.getTokenSecret());
                    edit.commit();

                    String token = prefs.getString(OAuth.OAUTH_TOKEN, "");
                    String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, "");

                    consumer.setTokenWithSecret(token, secret);
                    context.startActivity(new Intent(context,MainAct.class));

                    executeAfterAccessTokenRetrieval();

                    Log.i(TAG, "OAuth - Access Token Retrieved");

                } catch (Exception e) {
                    Log.e(TAG, "OAuth - Access Token Retrieval Error", e);
                }

                return null;
    }

manifest – PrepareRequestTokenActivity

<activity android:name=".PrepareRequestTokenActivity" android:launchMode="singleTask">>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="x-oauthflow-twitter" android:host="callback" />
        </intent-filter>
</activity>

I don’t understand why it doesn’t retrieve OAUTH_TOKEN and OAUTH_SECRET.
How to authorize without entering PIN number? Am I doing something wrong?

Please help me.

Thank you

  • 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-04T10:17:25+00:00Added an answer on June 4, 2026 at 10:17 am

    I solved the problem.
    It was a problem with the callback URL.

    I edited constants like this and it worked.

    public static final String  OAUTH_CALLBACK_SCHEME   = "x-oauthflow-twitter";
    public static final String  OAUTH_CALLBACK_HOST     = "callback";
    public static final String  OAUTH_CALLBACK_URL      = OAUTH_CALLBACK_SCHEME + "://" + OAUTH_CALLBACK_HOST;
    

    thank you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a twitter bootstrap carousel into my page but have run into
I have an Android application that I've been working on, and it's implemented using
I am woking on twitter application. I have used Twitter Request package and implemented
I have implemented a twitter login for my site, using a plugin called Simple
i have a twitter application that retrieves user timeline and appends it to a
I have simple RoR 3.2 application with Twitter bootstrap 2.1.0 (i implemented it via
i have implemented twitter bootstraps Tooltip before. But this time when I did it,
I am new to integrating Twitter. I have implemented Twitter in my application with
i have implemented placeholder just like twitter and google does but i want to
I have implemented Twitter OAuth in my web application, the web application currently fetches

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.