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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:11:22+00:00 2026-05-24T12:11:22+00:00

Hello I am having difficulty using the JTwitter functions to authenticate with my twitter

  • 0

Hello I am having difficulty using the JTwitter functions to authenticate with my twitter application. I always get a “TwitterException”

Here is my method

OAuthSignpostClient oauthClient = new OAuthSignpostClient(consumerKey, 
            privateKey, "oob");

a) I don’t know what the “oob” value SHOULD be, it is the “callbackURL” and in my application on twitter it says "callBack URL: none" so I have tried putting "none", "None", and null where "oob" with no differing results.

then the rest is boilerplate

 Intent i = new Intent(Intent.ACTION_VIEW, 
    Uri.parse(oauthClient.authorizeUrl().toString()));
    startActivity(i);
    // get the pin
    String v = oauthClient.askUser("Please enter the verification PIN from Twitter");
    oauthClient.setAuthorizationCode(v);
    // Store the authorisation token details for future use
    String[] accessToken = oauthClient.getAccessToken();
    // Next time we can use new OAuthSignpostClient(OAUTH_KEY, OAUTH_SECRET, 
    //        accessToken[0], accessToken[1]) to avoid authenticating again.

    EditText twitterText = (EditText)findViewById(R.id.twitterText);
    twitterText.getText();

    // Make a Twitter object
    Twitter twitter = new Twitter(null, oauthClient);
    // Print Daniel Winterstein's status
    //System.out.println(twitter.getStatus("winterstein"));
    // Set my status
    twitter.setStatus(twitterText.getText());

at this point, I’m simply not sure on how to make this work. Wish I could be more verbose about it, but it has something to do with the authentication. Online things I’ve seen haven’t been helpful

  • 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-05-24T12:11:23+00:00Added an answer on May 24, 2026 at 12:11 pm

    Try this as your callback url:

    OAuthSignpostClient oauthClient = 
        new OAuthSignpostClient(consumerKey, privateKey, "callback://twitter");  
    

    Remember! After:

        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
    

    Do the following

    override onResume() to get the verification code

    protected void onResume() {
        super.onResume();
        if (this.getIntent()!=null && this.getIntent().getData()!=null){
            Uri uri = this.getIntent().getData();
            if (uri != null && uri.toString().startsWith("callback://twitter")) {
                //Do whatever you want
                //usually use uri.getQueryParameter(someString);
                //test what could be someString using Log.v("",uri.toString());
                //you want the Authorization code which is a couple of numbers
                //so you could use oauthClient.setAuthorizationCode(v); 
                //and finally initialise Twitter
            }
        }
    }
    

    You can use uri.getQueryParameterNames() to get the parameter String names.


    @BobVork

    I’d just like to add that you’ll need to have a callback URL set in the Settings tab for your Twitter app (on twitter.com).

    It doesn’t even matter what you put in the field, but if it’s empty, callback urls will not work.

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

Sidebar

Related Questions

Hello im having an issue when using the % operator in my class method
Hello I am having a problem with the numbering of figures using Latex, I
hello fellow java developers. I'm having a bit of an issue here. I have
i am having and by using jquery ineed to assign another text hello to
Hello I am having trouble using multiquery in facebook .net. I am trying to
Hello I am having difficulty changing the visual view of the fragment activity. I
I am having difficulty trying to get a very simple scenario working with PRISM
Hello i am having a issue with htaccess mod_rewrite, maybe someone here could point
Hello I am having syntax issues here completely confused on how to properly do
Using Google's Hello TabWidget tutorial found here I was able to build a tabWidget

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.