Back to project page DoomPlay.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUC...
If you think the Android project DoomPlay listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.api; /*w ww .j a v a 2s. c o m*/ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.Serializable; import java.util.ArrayList; public class AudioAlbum implements Serializable { public final long album_id; public final String title; private static final long serialVersionUID = 1L; private static AudioAlbum parse(JSONObject o) throws JSONException { return new AudioAlbum(o.getLong("album_id"),Api.unescape(o.optString("title"))); } public AudioAlbum(long album_id,String title) { this.title = title; this.album_id = album_id; } public static ArrayList<AudioAlbum> parseAlbums(JSONArray array) throws JSONException { ArrayList<AudioAlbum> albums = new ArrayList<AudioAlbum>(); if (array == null) return albums; int category_count = array.length(); for(int i = 1; i < category_count; ++i) { JSONObject o = (JSONObject)array.get(i); AudioAlbum m = AudioAlbum.parse(o); albums.add(m); } return albums; } }