开发者

Help with OAUTH twitter post from Android

I want to use https://github.com/brione/Brion-Learns-OAuth for posting twitter status from android

But I have problem with filling this constants. Where to find

public static final String USER_TOKEN 
public开发者_开发技巧 static final String USER_SECRET 
public static final String REQUEST_TOKEN
public static final String REQUEST_SECRET
private static final Uri CALLBACK_URI

I create app in twitter , I guess USER_SECRET is Consumer secret. But I don't know other values.

Thanks


public static final String USER_TOKEN 
public static final String USER_SECRET 

User Token and User Secret are provided by Twitter when you register your application. (required to initiate the OAuth dance with Twitter).

public static final String REQUEST_TOKEN
public static final String REQUEST_SECRET

There are just 2 constants used in the sample application (used as keys) to store the actual request token and token secret you'll receive during the OAuth dance.

private static final Uri CALLBACK_URI

The callback URI defines where twitter will redirect the user after he authorizes the request. In case of a webapp, this can be a URL pointing to your application. In case of an Android app, this can be any URI.

For example, the following activity expects a callback url to look like x-oauthflow://callback.

    <activity android:name=".PrepareRequestTokenActivity" android:launchMode="singleTask">>
        <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="x-oauthflow" android:host="callback" />
        </intent-filter>
    </activity>

For more info, check this page : http://blog.doityourselfandroid.com/2010/11/10/oauth-flow-in-android-app/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜