views:

354

answers:

3

Hi all, Working on android application, wanna add twitter feature to it , like after every commute send the twit to the user account . Is it possible to add twitter into the android app without asking for user's twitter account details (user_name and password). I think using Twidroid it is possible but i dont know how to proceed .Please guide .

thank u, regards Sheik

+2  A: 

If you want to send updates to Twitter using their API you will somehow have to provide the username and password for your Twitter account. Of course you can enter these once and store them in your preferences. For some code see this example of a Twitter client.

Maurits Rijk
+1  A: 

The code to piggy-back the Twidroid application to sent tweets is at their website:

Intent sendIntent = new Intent(Intent.ACTION_SEND); 
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is a sample message"); 
sendIntent.setType("application/twitter");      
startActivity(Intent.createChooser(sendIntent, null)); 

Please note that this requires users to have Twidroid preinstalled.

Rene
A: 

I'd recommend using the oauth-signpost library and the example source code here. Worked great for me, and you're not storing usernames and passwords.

gibbo