Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdating status on twitter in android
    primarykey
    data
    text
    <p>I am trying to integrate twitter in android.I logged into twitter as a parse user but can't update my status as i'm now getting a forbidden 403 error .What may be the reason for 403 error and how to rectify it?Any help would be appreciated.. My code is</p> <pre><code>public void twitterbtnClick(View v) { ParseTwitterUtils.logIn(this, new LogInCallback() { @Override public void done(ParseUser arg0, com.parse.ParseException arg1) { // TODO Auto-generated method stub if (arg0 == null) { Log.d("MyApp", "Uh oh. The user cancelled the Twitter login."); } else if (arg0.isNew()) { Log.d("MyApp", "User signed up and logged in through Twitter!"); TweetsTask task = new TweetsTask(); task.execute("Hi buddies"); } else { Log.d("MyApp", "User logged in through Twitter!"); TweetsTask task = new TweetsTask(); task.execute("Hi buddies"); } } }); } public class TweetsTask extends AsyncTask&lt;String, Void, String&gt; { @Override protected String doInBackground(String... params) { // TODO Auto-generated method stub Log.d("Parameter",""+params[0]); HttpClient client =new DefaultHttpClient(); String status = params[0]; Log.d("Status",""+status); List&lt;NameValuePair&gt; parameters = new ArrayList&lt;NameValuePair&gt;(); parameters.add(new BasicNameValuePair("mystring", status)); Log.d("Parameter2",""+status); HttpPost httppost = new HttpPost("https://api.twitter.com/1.1/statuses/update.json"); try { httppost.setEntity(new UrlEncodedFormEntity(parameters)); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } ParseTwitterUtils.getTwitter().signRequest(httppost); try { HttpResponse response = client.execute(httppost); if(response==null){ task="fail"; }else{ task="success"; } } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return task; } } protected void onPostExecute(String result) { if(task.equals("success")) { Toast.makeText(getApplicationContext(),"success",Toast.LENGTH_SHORT).show(); }else{ Toast.makeText( getApplicationContext()," error",Toast.LENGTH_SHORT).show(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload