android - Prevent mocked GPS position from reverting to real values -
i'm developing mock location application myself , had success far. can set de desired location , shown in google maps.
my problem location switches real location provided gps module of nexus 7 lte (2013) android 6.0.1.
i set location service device , use provider locationmanager.gps_provider
this use set desired location:
newlocation.setlatitude(lat); newlocation.setlongitude(lon); newlocation.settime(system.currenttimemillis()); newlocation.setelapsedrealtimenanos(systemclock.elapsedrealtimenanos()); newlocation.setspeed((float) (speed / 3.6)); accuracy = (float) generaterandomdouble(accuracy_min, accuracy_max); newlocation.setaccuracy(accuracy); newlocation.setaltitude(altitude);
what did try solve this:
- setting new location every 200ms
- setting time stamps future
- setting accuracy 1
similar questions location mocking mock gps location issue didn't either.
what noticed jumps occur less if gps can't signal.
does have suggestions on how avoid 'jumps'?
i found way block internal gps aluminium foil.
that's not solution hoping works fine no more jumps.
Comments
Post a Comment