user1448729
user1448729

Reputation:

How to prevent other user to change gps location and Location updates called every small interval (say 3 seconds)

I've seen some application like gpsspoofer and fake gps apps that set location to spoof wrong location but my app to get right location please give suggestions.

My another problem

    Loc.requestLocationUpdates(Provider.get(i), 600000, 1000, new LocationListener() {
        @Override
        public void onStatusChanged(String provider, int status,Bundle extras) {
        /// some thing
       }
       @Override
       public void onProviderEnabled(String provider) {
       /// some thing
      } 
       @Override
       public void onProviderDisabled(String provider) {
        /// some thing
       }
       @Override
       public void onLocationChanged(Location location) { 
      /// some thing
      }
     });
    }

My question is if i have already set location updates for 600000 miliseconds then why onLocationChanged(Location location) is called every small interval which is less than both 1000 and 6000000

Upvotes: 3

Views: 1886

Answers (2)

Dion Segijn
Dion Segijn

Reputation: 2655

As far as i know it is possible. Gps can be retrieved from two things. GPS from the phone itself, this one can be spoofed by someone without root acces by using mocklocation. and someone with root and the right privileges without mocklocation turned on. Also the location of the user can be calculated using the wifi (wps). I don't know if there is any way to simply fake the wps location, but if you combine these two, and these are not the same you can know if someone is faking the gps.

Upvotes: 3

Paul Sweatte
Paul Sweatte

Reputation: 24617

Simple answer: you cannot. Your app gets the GPS location from the system. Those apps work in such a way that they make the system return you spoofed/incorrect values. If you're running on a rooted phone and have root privs, then you can check whether GPS calls are being intercepted and do something about it. Otherwise you're out of luck.

Reverse question: How can you detect whether there is a GPS simulation of some kind? http://gpscreations.com/Products_GPS_SIM14.html That is to say, you can't ever be sure. Even for software solutions, if you're checking, the apps may have expected this and have anti-checking mechanisms; so you need to check for those; this, too, may have been expected etc. - turtles all the way down :-(

Upvotes: 1

Related Questions