Today want to through Sina Weibo Openapi, do a client come out. It can be said that the process is more difficult. This is only a matter of recording the problems encountered, the other according to the API requirements to register, create the application of what is good.
1. API jar Reference problem
Created your own project and referenced the WEIBOSDK project according to the documentation, and found that there were always errors in the code where the API was referenced. This is due to the WEIBOSDK project in the bin directory will generate a Weibocore.jar, when our project to introduce the SDK project will be added to this jar, and will reference the SDK project under the Libs Weibosdkcode.jar, this time due to the introduction of the jar package in order to cause error. By right-clicking on the project in the---build path--configure build path, as shown, adjust the order of Android Dependencies and Android Private libraries as shown in the
2, using the login button click after the error redirect_uri_mismatch
Think of should be redirect_url = "http://www.sina.com"; problems, or network problems, modified to https://api.weibo.com/oauth2/default.html, using 3g, no
After looking for information should be this address can not be authenticated, so in the development platform, my application-application information-the advanced information can be seen
OAuth2.0 Authorization Setting Authorization
-
Callback page, where the address of the authorization callback page is set to be the same as Redirect_url, save it.
-
3. Login times SSO package or sign error error
When the above steps are correct, the SSO package or sign error appears again because the packages
are unsigned
In my application-application information-Basic information application basic information click Edit after the Android signature package information, enter our app package name, and download (HTTPS://GITHUB.COM/MOBILERESEARCH/WEIBO_ANDROID_SDK /blob/master/app_signatures.apk) Signing Tool, enter the package name to sign the MD5 signature string into the signature of the application information, save the retry, found that the token can be successfully returned and displayed.
The problem record of openapi practice in Weibo