Search in sources :

Example 1 with WikipediaBio

use of org.musicbrainz.mobile.async.external.result.WikipediaBio in project musicbrainz-android by jdamcd.

the class WikipediaClient method parseResult.

private String parseResult(InputStream stream) {
    Reader reader = new InputStreamReader(stream);
    JsonObject obj = new JsonParser().parse(reader).getAsJsonObject();
    WikipediaBio response = new Gson().fromJson(obj.get("mobileview"), WikipediaBio.class);
    return response.sections.get(0).text;
}
Also used : WikipediaBio(org.musicbrainz.mobile.async.external.result.WikipediaBio) InputStreamReader(java.io.InputStreamReader) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) JsonObject(com.google.gson.JsonObject) Gson(com.google.gson.Gson) JsonParser(com.google.gson.JsonParser)

Aggregations

Gson (com.google.gson.Gson)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 InputStreamReader (java.io.InputStreamReader)1 Reader (java.io.Reader)1 WikipediaBio (org.musicbrainz.mobile.async.external.result.WikipediaBio)1