2

I am trying to write a Sign In twitter screen android application. I am having trouble to understand the way URI works.

  • What kind of data does it takes?

  • What does uri.toString().startsWith("mycallback_URL") represents?

  • What for is String verifier = uri.getQueryParameter("oauth_verifier") used ?

    public void TwitterLogin() 
    {
        Uri uri = getIntent().getData();
        if(uri != null && uri.toString().startsWith("mycallback_URL")) 
        {
            String verifier = uri.getQueryParameter("oauth_verifier");
            new TwitterTasks.TwitterGetAccessTokenTask(MainActivity.this, MainActivity.this).execute(verifier);
        }
    }
    

TwitterTasks is another class containing an inner class TwitterGetAccessTokenTask

1 Answers1

0

There is an easier way of using Twitter APIs than the one you are using now. Sign in and create your App on twitter developer console, get the consumer key and secret. Download Temboo library here. Follow the Choreo example and instructions to make your task easier.