The most frequently asked questions in my blog are related to oauth. There are many problems, many of which are stuck in this step.
For this reason, it took some time to write a complete example of oauth authentication for the Android version of Sina Weibo client. This code is just a function implementation example without considering the robustness of the program, please complete it by yourself.
However, the uerid, userkey, and usersecret can be obtained successfully after oauth is run.
For detailed implementation, see:
Android development my Sina Weibo client-oauth (2.1)
Here we will not talk nonsense. We will directly provide the project source file for download: oauth4sina.rar
After downloading the project file, modify the following two lines in the source code:
String consumerkey = "fill in your own ";
String consumersecret = "fill in your own ";
Then you can run the debugging. The result is as follows: