Back to project page worldwondersproject.
The source code is released under:
MIT License
If you think the Android project worldwondersproject 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.ciandt.cursoandroid.worldwondersapp.businesscoordinator; //from w ww . j a v a2 s. c o m import com.ciandt.cursoandroid.worldwondersapp.entity.Place; import com.ciandt.cursoandroid.worldwondersapp.integrator.PlaceIntegrator; import org.json.JSONArray; import org.json.JSONObject; import java.util.ArrayList; import java.util.List; public class PlaceBusinessCoordinator { public List<Place> getAllPlaces() { PlaceIntegrator placeIntegrator = new PlaceIntegrator(); List<Place> places = new ArrayList<Place>(); try { JSONObject jsonObject = placeIntegrator.getAllPlaces(); JSONArray jsonArray = jsonObject.getJSONArray("data"); for (int i = 0; i < jsonArray.length(); i++) { Place place = new Place(jsonArray.getJSONObject(i)); places.add(place); } } catch (Exception ex) { ex.printStackTrace(); } finally { return places; } } }