views:

83

answers:

1

Hi,

I am trying to post on Twitter from Android; first I considered http://code.google.com/p/oauth-signpost/wiki/TwitterAndSignpost but it asks the user to go on site and authorize the application, then to manually input the PIN in order to start posting. Next, starting with http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/#awp::2009/07/16/android-oauth-twitter-updates/ and following all the suggestions in the discussion threads I struggled to get the callback URL to get me back to my application after Twitter authorization. I did not succeed.

My question is: in the AndroidManifest.xml, under:

    <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="myapp" android:host="twitt" />
        </intent-filter>

what exactly should be the scheme? The exact string "myapp", the name of my Android application, the name of my application created on Twitter? And host, is it mandatory?

Assuming that:

How should the intent-filter data be defined? The callback url must be a real, browsable url?

Can somebody, please, show me the intent filter of a working example ?

I am anxious to receive an answer to help me go further, thank you in advance.

+1  A: 

I wouldn't recommend you using OAuth. It requires browser redirection so it's really bad user experience. Of cource you can overcome this requirement but its not that easy to do.

You could use xAuth instead http://dev.twitter.com/pages/xauth. It's as secure as OAuth but it's browserless and is designed for desktop/mobile applications. So xAuth will be much more user friendly.

Fedor
Thank you Feodor, I'll try to follow those instructions and I'll post the feedback.BTW, do you have any hint for FaceBook too?
Manu