How to check callback_url in twitter application
<p>i have loads of examples for O_Auth but no one is working properly and i guess the only thing is callback URL in every example, I am getting 401 error like consumer key or signature didn't match. I already seen so many examples on 401 the only thing that goes into my favor is my callback url.</p>

<p><a href="http://stackoverflow.com/questions/3586076/android-app-cannot-connect-to-twitter">android app cannot connect to twitter</a>.
     <a href="http://stackoverflow.com/questions/5448632/getting-401-when-requesting-access-token-">Getting 401 when requesting access token with signpost within android</a>  with-signpost-within-android
   <a href="http://stackoverflow.com/questions/5545803/android-dev-callback-url-not-working-0-o">Android Dev - Callback URL not working... (0_o)</a></p>

<p>I already seen all these examples and many more.</p>

<p>But still i am not getting my point, If at the time of application form i use <a href="http://www.meomyo.com" rel="nofollow">http://www.meomyo.com</a> at callback url, Then what should i use it in my coding 
like android:scheme="?" android:host="?"
currrently i am using other examples callbacks</p>

<pre><code>    //private static final Uri CALLBACK_URI = Uri.parse("bloa-app://twitt");
private static final Uri CALLBACK_URI = Uri.parse("twitterapp://connect");
</code></pre>

<p>i have consumer key as well secret key, but in case of callback url i am stuck on it.
If anyone want i can provide my consumer as well secret key. </p>

<pre><code>public class OAuth extends Activity {

private static final String APP =   "OAUTH";

private Twitter twitter;
private OAuthProvider provider;
private CommonsHttpOAuthConsumer consumer;

private String CONSUMER_KEY =       "Xh3o8Gh1JQnklkUnTvvA";
private String CONSUMER_SECRET =    "SCLy6yoUSth53goAsYYkoqR4ZuBoaInyJXsm5PQR11I";
private String CALLBACK_URL =       "merabharatmahan://piyush";

private TextView tweetTextView;
private Button buttonLogin;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    tweetTextView = (TextView)findViewById(R.id.tweet);
    buttonLogin = (Button)findViewById(R.id.ButtonLogin);
    buttonLogin.setOnClickListener(new OnClickListener() {  
        public void onClick(View v) {
            askOAuth();
        }
    });
}

/**
 * Open the browser and asks the user to authorize the app.
 * Afterwards, we redirect the user back here!
 */
private void askOAuth() {
    try {
        consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
        provider = new DefaultOAuthProvider("http://twitter.com/oauth/request_token",
                                            "http://twitter.com/oauth/access_token",
                                            "http://twitter.com/oauth/authorize");
        String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);
        Toast.makeText(this, "Please authorize this app!", Toast.LENGTH_LONG).show();
        this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
    } catch (Exception e) {
        Log.e(APP, e.getMessage());
        Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
    }
}


/**
 * As soon as the user successfully authorized the app, we are notified
 * here. Now we need to get the verifier from the callback URL, retrieve
 * token and token_secret and feed them to twitter4j (as well as
 * consumer key and secret).
 */
@Override
protected void onNewIntent(Intent intent) {

    super.onNewIntent(intent);

    Uri uri = intent.getData();
    if (uri != null &amp;&amp; uri.toString().startsWith(CALLBACK_URL)) {

        String verifier = uri.getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);

        try {
            // this will populate token and token_secret in consumer
            provider.retrieveAccessToken(consumer, verifier);

            // TODO: you might want to store token and token_secret in you app settings!!!!!!!!
            AccessToken a = new AccessToken(consumer.getToken(), consumer.getTokenSecret());

            // initialize Twitter4J
            twitter = new TwitterFactory().getInstance();
            twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
            twitter.setOAuthAccessToken(a);

            // create a tweet
            Date d = new Date(System.currentTimeMillis());
            String tweet = "#OAuth working! " + d.toLocaleString();

            // send the tweet
            twitter.updateStatus(tweet);

            // feedback for the user...
            tweetTextView.setText(tweet);
            Toast.makeText(this, tweet, Toast.LENGTH_LONG).show();
            buttonLogin.setVisibility(Button.GONE);

        } catch (Exception e) {
            Log.e(APP, e.getMessage());
            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
        }

    }
}
</code></pre>

<p>}</p>

<p>manifest code is</p>

<pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
    &lt;activity android:name=".OAuth"
              android:label="@string/app_name"
              android:launchMode="singleInstance"&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;
            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
        &lt;intent-filter&gt;
            &lt;action android:name="android.intent.action.VIEW" /&gt;
            &lt;category android:name="android.intent.category.DEFAULT" /&gt;
            &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
            &lt;data android:scheme="merabharatmahan" android:host="piyush" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;

&lt;/application
</code></pre>

<p>now i am getting communication with the service provider is failed: Received Authentication challenge is null. It is the simplest example that i put here.</p>
