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:

  1. setting new location every 200ms
  2. setting time stamps future
  3. 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

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -