Ваш URL обратного вызова должен быть "sosInternational: // HierBenIkNu" (вместо "sosInternational: /// HierBenIkNu") в коде Java.

аюсь интегрировать твиттер в свое приложение, но не могу заставить его работать.

Это мой код:

public class OAuthForTwitter extends Activity {

    private CommonsHttpOAuthConsumer httpOauthConsumer;
    private OAuthProvider httpOauthprovider;
    public final static String consumerKey = "xxxxxxxxxxxxxx";
    public final static String consumerSecret = "xxxxxxxxxxxx";
    private final String CALLBACKURL = "sosInternational:///HierBenIkNu";
    private Twitter twitter;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        doOAuth();
    }

    /**
     * Opens the browser using signpost jar with application specific
     * consumerkey and consumerSecret.
     */

    private void doOAuth() {
        try {
            httpOauthConsumer = new CommonsHttpOAuthConsumer(consumerKey, consumerSecret);
            httpOauthprovider = new DefaultOAuthProvider(
                    "http://twitter.com/oauth/request_token",
                    "http://twitter.com/oauth/access_token",
                    "http://twitter.com/oauth/authorize");
            String authUrl = httpOauthprovider.retrieveRequestToken(httpOauthConsumer, CALLBACKURL);
            this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
        } catch (Exception e) {
            Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
        }
    }

    @Override
    protected void onNewIntent(Intent intent) {

        super.onNewIntent(intent);

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

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

            try {
                // this will populate token and token_secret in consumer

                httpOauthprovider.retrieveAccessToken(httpOauthConsumer,
                        verifier);

                // TODO: you might want to store token and token_secret in you
                // app settings!!!!!!!!

                AccessToken a = new AccessToken(httpOauthConsumer.getToken(),
                        httpOauthConsumer.getTokenSecret());

                // initialize Twitter4J

                twitter = new TwitterFactory().getInstance();
                twitter.setOAuthConsumer(consumerKey, consumerSecret);
                twitter.setOAuthAccessToken(a);

                // create a tweet

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

                // send the tweet

                twitter.updateStatus(tweet);

            } catch (Exception e) {

                Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
            }

        }
    }
}

Когда я закончу аутентификацию на сайте Twitter, он должен перенаправить меня обратно в приложение.

Но вместо этого я получаю эту страницу не найдена:

У меня есть это в моем AndroidManifest:

<intent-filter>  
        <action android:name="android.intent.action.VIEW"></action>  
        <category android:name="android.intent.category.DEFAULT"></category>  
        <category android:name="android.intent.category.BROWSABLE"></category>  
        <data android:scheme="sosInternational" android:host="HierBenIkNu"></data>  
    </intent-filter>  

Как я могу вернуться к своему приложению с ключами, которые я получу обратно?

Ответы на вопрос(3)

Ваш ответ на вопрос