You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
Hi,
I have a problem...in this sample you use geofence from Constant...unfortunately i'm not able to load geofences dynamically :-(
Maybe I wrong something...
In onCreate method:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);
// Empty list for storing geofences.
mGeofenceList = new ArrayList<Geofence>();
// Initially set the PendingIntent used in addGeofences() and removeGeofences() to null.
mGeofencePendingIntent = null;
geofencePointsRequest(this, null, null);
}
Volley request to retrieve data
public void geofencePointsRequest(final Context context, Map<String,String> params, final ProgressDialog pDialog){
webService = new WebService();
CustomArrayRequest jsonObjReq = new CustomArrayRequest(
Request.Method.GET,
WebServiceUrl.POINTS,
params,
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
ArrayList<Point> points = webService.getPoints(response);
populateGeofenceList(points);
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
String errorHandler = webService.getError(error);
int status = (error.networkResponse.statusCode != 0) ? error.networkResponse.statusCode : 0;
Toast.makeText(context, "Code : " + status + " - Error : " + errorHandler, Toast.LENGTH_LONG).show();
}
}) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
return webService.getHeaders();
}
};
VolleySingleton.getInstance(context).addToRequestQueue("pointsRequest", jsonObjReq);
}
Hi,
I have a problem...in this sample you use geofence from Constant...unfortunately i'm not able to load geofences dynamically :-(
Maybe I wrong something...
In onCreate method:
Volley request to retrieve data
Build GoogleApiClient
On connected I load geofences
I create a list of geofences (from data parsed)
Thanks in advance :-)
The text was updated successfully, but these errors were encountered: