Back to project page wristband-android.
The source code is released under:
The Artistic License 2.0 Copyright (c) 2014 Allan Pichardo Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed...
If you think the Android project wristband-android 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.nimo.wristband.net; //from w ww .j a v a 2 s . c o m import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class WristbandResponse { private List<Show> shows; private boolean isSuccess; private String res; public WristbandResponse(String response){ res = response; isSuccess = true; shows = new ArrayList<Show>(); JSONObject json = null; try { json = new JSONObject(response); } catch (JSONException e) { isSuccess = false; e.printStackTrace(); } if(isSuccess){ JSONArray array = json.optJSONArray("shows"); for(int i = 0; i < array.length(); ++i){ Show show = new Show(array.optJSONObject(i)); shows.add(show); } } isSuccess = json.optBoolean("execution", false); } public boolean isSuccess(){ return isSuccess; } public List<Show> getShows(){ return shows; } @Override public String toString() { return res; } }