locationSensor.MIN_DISTANCE_INTERVAL

21 views
Skip to first unread message

Steve Marcus

unread,
Jul 27, 2013, 6:58:49 AM7/27/13
to alternate-java-bridg...@googlegroups.com
How do you set the MIN_DISTANCE_INTERVAL of the location sensor?

I've got the usual - 

LocationSensor locationSensor;

then 

locationSensor = new LocationSensor(this);
  locationSensor.MIN_TIME_INTERVAL = 60000;
  locationSensor.Enabled(false);

however if I try to add:

locationSensor.MIN_DISTANCE_INTERVAL = 100;

an error appears with:

- The static field LocationSensor.MIN_DISTANCE_INTERVAL should be accessed in a static way
- The final field LocationSensor.MIN_DISTANCE_INTERVAL cannot be assigned

How to remove these errors?

Thanks!


S

Imp Inc

unread,
Jul 27, 2013, 1:53:12 PM7/27/13
to alternate-java-bridg...@googlegroups.com
You should use the methods to set them

 locationSensor.setMinTimeInterval(60000);
 locationSensor.setMinDistanceInterval(100);

The distance interval was set to static final, so it could not be changed. I've changed these both to private, and created the method for min distance so they both can be set. I updated the jar on the server, so you should be able to see it if you do Update AltBridge jar file from the AltBridge tools menu.

Note that the default for min time interval is already 60000, so the above is redundant. The min Distance Interval is set to 5 as a default. (meters)

Ryan

Steve Marcus

unread,
Jul 28, 2013, 8:31:39 AM7/28/13
to alternate-java-bridg...@googlegroups.com
Ah ok I didn't see those. Thanks for the jar update.
Reply all
Reply to author
Forward
0 new messages