Last active
December 11, 2015 16:19
-
-
Save shannah/4627312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testLoadJSONUsingJSONParser(){ | |
ConnectionRequest req = new ConnectionRequest(){ | |
@Override | |
protected void readResponse(InputStream input) throws IOException { | |
//super.readResponse(input); | |
InputStreamReader reader = new InputStreamReader(input); | |
JSONParser parser = new JSONParser(); | |
Hashtable response = parser.parse(reader); | |
String version = (String)response.get("version"); | |
Hashtable feed = (Hashtable)response.get("feed"); | |
Hashtable title = (Hashtable)feed.get("title"); | |
String titleStr = (String)title.get("$t"); | |
// .. Work with content some more | |
} | |
}; | |
req.setPost(false); | |
req.setHttpMethod("GET"); | |
req.setUrl("http://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json"); | |
NetworkManager.getInstance().addToQueue(req); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment