English 中文(简体)
签字人OAuth On : 如何在两种减让性交易中重新吸收消费者?
原标题:Signpost OAuth on Android: how to re-create the Consumer between two succesive runs?

顺便提一下,我会利用签字人授权通过奥阿瑟在谷歌账户中呼吁保护资源。

然而,用户必须每次通过谷歌和准许进入,这似乎只是一种奇怪的。 是否有必要对消费者进行序列化和重新定性,以便不需要再批准? 我试图在共同的偏好中保持原样、秘密和真实性,并将之置于消费者手中,但我收到了奥阿思·斯特雷克基金。

任何想法?

最佳回答

一俟你获得象征性的治疗,你就可以将其储存在你们的首选中:

provider.retrieveAccessToken(consumer, oauth_verifier);

final Editor edit = prefs.edit();
edit.putString(OAuth.OAUTH_TOKEN, consumer.getToken());
edit.putString(OAuth.OAUTH_TOKEN_SECRET, consumer.getTokenSecret());
edit.commit();

之后,你总是能够重新接纳消费者,如:

private OAuthConsumer getConsumer(SharedPreferences prefs) {
    String token = prefs.getString(OAuth.OAUTH_TOKEN, "");
    String secret = prefs.getString(OAuth.OAUTH_TOKEN_SECRET, "");
    OAuthConsumer consumer = new CommonsHttpOAuthConsumer(Constants.CONSUMER_KEY, Constants.CONSUMER_SECRET);
    consumer.setTokenWithSecret(token, secret);
    return consumer;
}

一旦你去了消费者,你就可以打电话给消费者,消费者会签署。

DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet request = new HttpGet(url);
consumer.sign(request);
HttpResponse response = httpclient.execute(request);

根据 签字后:

外国后标物体是轻重,因此建议为您的申请中的每一条线铺设一个OAuthConsumer和OAuthProvider,必须寄出签署《吉大港行动计划》要求。 这两种物体也具有序列意义,因此,你可以坚持下去,并在以后恢复。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签