Ejemplo n.º 1
0
  public static List<Equipos> getEquiposByCategoria(Context ctx, String liga, String cat) {
    StringBuilder jsonCalendario = AppUtils.getJsonFromDisk(ctx, "equipos");
    Type typeEquipos = new TypeToken<List<Equipos>>() {}.getType();
    List<Equipos> l = JSONUtils.factoryGson().fromJson(jsonCalendario.toString(), typeEquipos);
    List<Equipos> retorno = new ArrayList<Equipos>();

    for (Equipos e : l) {
      if (e.getLiga().equals(liga) && e.getCategoria().equals(cat)) retorno.add(e);
    }

    l = null;
    return retorno;
  }
Ejemplo n.º 2
0
 public static List<Equipos> getAll(Context ctx) {
   StringBuilder jsonCalendario = AppUtils.getJsonFromDisk(ctx, "equipos");
   Type typeEquipos = new TypeToken<List<Equipos>>() {}.getType();
   return JSONUtils.factoryGson().fromJson(jsonCalendario.toString(), typeEquipos);
 }