Microblogging android SDK, how to get the microblogging message?
StatusAPI There is a method publicTimeline, comment is "Return latest public microblogging" in the API documentation, this function should return JSON format, the name is Statuses, but in the Android api, this function is the Void, that I Returns should be how to get this result? Please large cattle pointers Reply: Get the Timeline method has one parameter is RequestListener data in this listener's OnComplite where you can get Reply: In fact, this argument is a callback object after the request corresponds to a different state to call different methods Reply:
Microblogging Status information should be the object, the function can return this object? listener wording is not very familiar with, requestLister is the interface, there onComplete () method, you need to write here to get Status object's methods, but where do get this object Reply:
I see the previous example, where the sdk is weibo4j is Weibo.getFriendsTimeline (p); But now the android sdk in how to achieve it? Reply:
onComplete method has a String parameter This parameter is to get to the JSON string
public void onComplete (String response) { try { JSONObject timeline = new JSONObject (json); timeline.getString ("You want something key") / / Handle the things you want } Catch (JSONExceptione) { e.printStackTrace (); } }
What KEY corresponds to what see http://open.weibo.com/wiki/2/statuses/public_timeline
Note: onComplete where things are running in a new thread if you want to change the UI, then we must be sent to the handler in onComplete message
Reply: weibo4j is not the Android SDK for JAVA eh ... Reply:
This code is to write your own, or in a bag? Is there a simple example, I learn a little bit slowly write too strenuous there seems to be only one authorized demo example Reply: write your own Reply:
Well, thank Reply: Why is my phone just to get the two pieces of information, but there are 20 official test, why you
No comments:
Post a Comment