transistorsoft / cordova-background-geolocation-SampleApp

Cordova Background Geolocation Sample Application
https://www.transistorsoft.com/shop/products/cordova-background-geolocation
MIT License
122 stars 78 forks source link

java.util.ConcurrentModificationException #54

Closed emoran closed 7 years ago

emoran commented 8 years ago

Hi, I'm consuming a service that returns around 190 locations, I tried to add all of those with this code

                angular.forEach(wrappedobj.data.estaciones, function(value, key) {

            $scope.geofenceRecord = {
                latitude: value.latitud,
                longitude: value.longitud,
                identifier: value.noestacion,
                radius: value.geodistance,
                notifyOnEntry: true,
                notifyOnExit: true
            };
            bgGeo.addGeofence($scope.geofenceRecord );
            createGeofenceMarker($scope.geofenceRecord);
        }); 

After build and run the application, in specific for Android it crash with this error:

screen shot 2016-08-10 at 11 36 35 pm

if I remove the bgGeo.addGeofence method it works fine.

Is there a limit adding Geofences? If so I assume I need to geolocate and retrieve a few locations based on my current geolocation.

christocracy commented 8 years ago

While you shouldn't get an error (I'll investigate that), there's an

addGeofences method which is more appropriate in your case. You can only

monitor 100 geofences on Android

On Wednesday, August 10, 2016, Edgar Moran notifications@github.com wrote:

Hi, I'm consuming a service that returns around 190 locations, I tried to add all of those with this code

` angular.forEach(wrappedobj.data.estaciones, function(value, key) {

    $scope.geofenceRecord = {
        latitude: value.latitud,
        longitude: value.longitud,
        identifier: value.noestacion,
        radius: value.geodistance,
        notifyOnEntry: true,
        notifyOnExit: true
    };
    bgGeo.addGeofence($scope.geofenceRecord );
    createGeofenceMarker($scope.geofenceRecord);
});

`

After build and run the application, in specific for Android it crash with this error:

[image: screen shot 2016-08-10 at 11 36 35 pm] https://cloud.githubusercontent.com/assets/1028534/17578138/62a5ecc0-5f53-11e6-888c-25d8dceaf927.png

if I remove the bgGeo.addGeofence method it works fine.

Is there a limit adding Geofences? If so I assume I need to geolocate and retrieve a few locations based on my current geolocation.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/transistorsoft/cordova-background-geolocation-SampleApp/issues/54, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA6l723aRpvDC_zQ2y55_Iq9wjU888Pks5qepl0gaJpZM4JhxfA .

Snet form Gmail Mobile

emoran commented 8 years ago

The addGeofences function works great and is not crashing anymore 👍 I will test this on field and keep you posted. Thanks for your always quick response