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

  • Home
  • SEARCH
  • 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 3808906
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:13:19+00:00 2026-05-19T15:13:19+00:00

I am integrating Twitter to Android through twitter4j. I can successfully read tweets posted

  • 0

I am integrating Twitter to Android through twitter4j. I can successfully read tweets posted by me.

Now I am trying to posting tweet from it, but I can’t. I am getting strange warning as below:

    02-01 16:28:43.298: WARN/System.err(729): 401:Authentication credentials were missing or incorrect.
02-01 16:28:43.308: WARN/System.err(729): {"request":"\/1\/statuses\/update.json","error":"Read-only application cannot POST"}
02-01 16:28:43.308: WARN/System.err(729): TwitterException{exceptionCode=[15bb6564-00e54a7f], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.1.7-SNAPSHOT(build: fd76317d18a608269f0566f73bbb827420c4c77e)}
02-01 16:28:43.308: WARN/System.err(729):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:309)
02-01 16:28:43.318: WARN/System.err(729):     at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:72)
02-01 16:28:43.318: WARN/System.err(729):     at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:103)
02-01 16:28:43.318: WARN/System.err(729):     at twitter4j.Twitter.updateStatus(Twitter.java:501)
02-01 16:28:43.330: WARN/System.err(729):     at com.T4J_OAuth.activities.Main$1.onClick(Main.java:69)
02-01 16:28:43.330: WARN/System.err(729):     at android.view.View.performClick(View.java:2364)
02-01 16:28:43.330: WARN/System.err(729):     at android.view.View.onTouchEvent(View.java:4179)
02-01 16:28:43.339: WARN/System.err(729):     at android.widget.TextView.onTouchEvent(TextView.java:6541)
02-01 16:28:43.339: WARN/System.err(729):     at android.view.View.dispatchTouchEvent(View.java:3709)
02-01 16:28:43.339: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 16:28:43.349: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 16:28:43.349: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 16:28:43.349: WARN/System.err(729):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
02-01 16:28:43.359: WARN/System.err(729):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
02-01 16:28:43.359: WARN/System.err(729):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
02-01 16:28:43.359: WARN/System.err(729):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
02-01 16:28:43.369: WARN/System.err(729):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
02-01 16:28:43.369: WARN/System.err(729):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
02-01 16:28:43.378: WARN/System.err(729):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 16:28:43.378: WARN/System.err(729):     at android.os.Looper.loop(Looper.java:123)
02-01 16:28:43.378: WARN/System.err(729):     at android.app.ActivityThread.main(ActivityThread.java:4363)
02-01 16:28:43.378: WARN/System.err(729):     at java.lang.reflect.Method.invokeNative(Native Method)
02-01 16:28:43.389: WARN/System.err(729):     at java.lang.reflect.Method.invoke(Method.java:521)
02-01 16:28:43.389: WARN/System.err(729):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-01 16:28:43.398: WARN/System.err(729):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-01 16:28:43.398: WARN/System.err(729):     at dalvik.system.NativeStart.main(Native Method)

Though I have set my application in Twitter as read and write, it says I can’t post by read only app.

  • 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-19T15:13:20+00:00Added an answer on May 19, 2026 at 3:13 pm

    Posting a tweet on twitter is different than getting the timeline.

    Taking Twitter4J into account the scenarios may be following:

    It requires you to have an instance of Twitter class which is authorised.

    You do following in order to get the timeline:

    Twitter twitter = new TwitterFactory().getInstance();
    twitter.setOAuthConsumer(consumerKey, consumerSecret);
    RequestToken requestToken = twitter.getOAuthRequestToken(CALLBACKURL); 
    ...
    ...
    

    After successful OAuth verification, you get the oauth_verifier variable, and then create an AccessToken with the following lines:

    AccessToken accessToken = twitter.getOAuthAccessToken(requestToken,oauth_verifier);
    String token = accessToken.getToken(), 
          secret = accessToken.getTokenSecret();
    

    Save the above token and secret somewhere, it will be used in generating the AccessToken later.

    Now, the code to update status:

    AccessToken accessToken = new AccessToken(token,secret);
    Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance(consumerKey,consumerSecret,accessToken);
    Status status = twitter.updateStatus("My First Status Update");
    statusId = (int)status.getId();
    

    This will update the message My First Status Update to your timeline and will get the ID of this status in the statusId variable.

    For a working example of how to use OAuth to implement sign-in with twitter and get the first tweet of your timeline, click this link to my blog post.

    I am sure that after a slight modification into that and the use of above code in it, you can transform it into a tweet posting code too!

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

Sidebar

Related Questions

I am working on twitter integration with android using Twiitter4j. I am trying to
I have created android application integrating with twitter and my application wants to authenticate
Anybody can please help in Android + Twitter Integration using OAuth. I already worked
I'm integrating my iOS app with Twitter, and I am using ARC. I can
Possible Duplicate: twitter integration on android app Hi all, how to post the tweets
I am making an app for twitter integration using Twitter4j API. Right now my
Now that twitter is on a media rampage you can see on twitter pictures
Possible Duplicate: twitter integration on android app How can I integrate Twitter with my
I'm integrating my application so that it can edit files stored in SharePoint. I'm
i am integrating twitter application in my application my application is created in xcode

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.