The licensing process for Android learning notes

Source: Internet
Author: User

1, you need to apply for app key and app Secret. Different development platforms have different access methods, you can refer to the documentation, and then put the two values in. 2, through the OAuth class to achieve authentication, it will automatically jump to the authentication interface, authorization, after successful processing callback interface. 3, when the callback interface is called in the second step, it returns the user's basic information, such as the user ID. You need to save the user ID information at this time to prepare for subsequent logins. The callback interface is written as MyApp://authorizeactivity, where scheme is all lowercase letters. <activity android:name="com.weibo.view.AuthActivity"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="MyApp"android:host="authactivity"/> </intent-filter> </activity>4, in the login, first to the database query whether there is User id,token,access token and other information, if there is a representation has been authorized, otherwise jump to the authorization interface, authorization. 5, after the authorization succeeds, obtains the user token and so on information. If you are loading user information (such as a user friend) at this point, you can get the data returned by the server by loading your friend's URL and configuration parameters according to the API.        The following response contain information about the user's friends. OAuth Auth=NewOAuth (); String URL="Http://api.t.sina.com.cn/statuses/friends_timeline.json"; List<BasicNameValuePair>params=NewArraylist<basicnamevaluepair>(); params. Add (NewBasicnamevaluepair ("Source", Auth.consumerkey)); HttpResponse Response= Auth. Signrequest (User.gettoken (), User.gettokensecret (), URL,params); 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.