Android Fake GPS location apps do not work anymore - android

I used to work with this application:
https://play.google.com/store/apps/details?id=com.fakegps.mock&hl=en
And before this with this one:
https://play.google.com/store/apps/details?id=com.incorporateapps.fakegps.fre&hl=en
Am working on a LG G3 and a Nexus 5, but in the last couple of days, the fake location doesn't work as it should.
It doesn't always modify my location and sets in where I want. Or many times, it sets my location where I want for a couple of seconds and then resets to my real location. I'm working on a travel app, and this made it very simple to simulate trips and locations.
Is there any other fake location app that actually works how it should?
Or is there any other way to set the location of my phone, while the app is running?
EDIT: YES! MOCK LOCATIONS is ON.
Like i said: It DOES change my location, to the mock location I want, but it jumps back to my REAL location, after a couple of seconds. Depending, sometimes, it stays for minutes on the mock location, but then jumps for 1 second on my real location, and then goes back :)
Now I know this, cause I log all the locations that I find, even more, draws the path, and I have lines that jump back to my Real location and then continue
PICTURE: Pink = how it should be.
Green = locations that I get and the path. As you can see, each a couple of locations that I get, it jumps back to my location
https://www.dropbox.com/s/sszzrvhnwlq2bxr/Screenshot%202015-09-10%2015.47.20.png?dl=0

If mocked location seems to jump to real one during simulation, try to turn off wifi based locations (Settings / Location / Mode --> Device only).

Make sure you have Allow Mock Location turned on in phone's Developer Options and try this app: https://play.google.com/store/apps/details?id=fr.dvilleneuve.lockito&hl=en
I'm using it when working on Geofencing and works great.

I managed to fix this problem by disabling the "Fused Location" service on my phone. I used the Disable Service application which requires root privileges to run. After disabling the "Fused Location" service I stopped teleporting to my real location.

In Settings -> General -> Location -> Mode
I switched it from Battery Saving to High accuracy and then the mock location app started working.
Note, you also need to set your preferred Mock Location app in Developer Options, but even after doing that my app was showing my true location instead of the mocked location - now it's working like a champ!

Related

Having issues testing location services. I can't make them NOT to work

I implemented getting location updates using FusedLocationProviderApi.
I need to track device location in background, when app is not running.
I followed the tutorials, I have a Service where I call requestLocationUpdates with an intent which starts a service.
I've purposely NOT implemented keeping a wake lock just to test and see that when the screen goes off, the device stops getting location updates. Once I verified that I could then go and implement the wake lock and expect the opposite, which is to see it working.
I used two devices: a Google Nexus 10 with KitKat and a Samsung Galaxy A5 (2016) with Lollipop.
On both devices, it keep sending updates (I'm sending the updates to a website).
I tested with screen off, after leaving device on a desk for a minute, and then walking again around the house.
I know Android 6 and Doze mode is more restrictive, but I want to nail and understand how it works on Android 4.4 and Android 5.
So frustrating! Any ideas how to actually make device go in sleep mode so I can see getting location updates stop working?
Funny, everything I've read is about making it work :)
EDIT: I'm confused why getting location updates is still working when screen is off even with an aggressive location update setup like the following:
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
locationRequest.setFastestInterval(2);
locationRequest.setInterval(1000);
Thing about requesting location updates is that underneath it all, the LocationManagerService, which is what LocationManager uses, actually creates and acquires it's own wakelock. So technically, your device will never go to sleep as long as you have a location listener registered to actively receive GPS. Now, I know you are using Google's FusedLocationApi, but underneath it all, it does use LocationManager. If you are interested in understanding the location code a little better, here is the source code for LocationManagerService.

Android Geofence Delay (10-20seconds)

I have built an Android app with Geofences following the instructions from the developer training. I have tested my app several times during the production proccess with mock locations - it worked like a charm. However, when i tested my app with real location data (always with GPS enabled) the app showed a delay of 10-20 seconds after entering or leaving a geofence. My first thought was that the GPS signal might be inaccurate. But I later added Google Maps to my app and I can now see the accuracy of the GPS-signal according to the circle around my current location - all should be fine.
Has anybody faced a similar problemor know how to fix it?
Thanks

Android Geofencing sample app only works if another app is open using GPS

I am working with the Geofence API Sample application I've got it running and seems to work alright. I did make the modifications to it to use BroadcastReceiver instead of the IntentService.
But I will only get the notifications if I have some other app open that is using GPS such as Maps, or GPS Tester app.
If I don't have one of those apps open and I walk into the geofence zone nothing happens. But as soon as I launch one of them I will get the notification within a few seconds.
I ended up creating a service that forces the GPS to stay active by requesting location updates on a relatively quick interval.
While this is admittedly a poor work around for a "real" application. It worked for my purposes. In which I needed to be able to present a working proof of concept to an audience, which impeded my ability to use a geo points which were further spread out.
Even I too had a struggle with getting Geofence notification as soon I entered Geofence or Exit the one.There were always delays in notifications until I found a really nice Location Library called little-fluffy-location-library which serves my purpose.Location updates will be broadcast to your app periodically.
According the Documentation it says that:
The library works by using Froyo's passive location listener (only possible with Android 2.2 and up, hence why it works best with it), which listens to location updates requested by other apps on your phone. The most accurate location is broadcast to your app approximately every 15 minutes. If a location update hasn't been received from another app for an hour, the library forces a location update of its own.
I think you should give a try with this Library and Let me know if it works for you!!

working LocationClient always returns null after turning location services on and off again

OK, so this is really freaky...
I switch from the old locationmanager to the new shiny locationclient a while back. Works fine, but i noticed a very strange thing while testing fringe settings cases:
As i said, working positoning app using google play's LocationClient as per examples etc.
I start my app, get a couple of positions, all work fine. (You could say that i have a button that fetches locations when you click on it)
I go into settings/location. I disable "Google location services", go back into app, get nothing. I then go back and reenable the setting!
However - i get nothing. ever. Even if i restart my app i never get a location it times out every time.
Only if i restart the phone i start getting positions again.
Anybody have any ideas? Thoughts would be appreciated.

Android GPS battery usage

I am writing a program in Android that uses GPS. It will prompt the user to turn on location services if it is not on (which I guess is equivalent to turning on gps ?). My question is: does the gps immediately start consuming extra battery power as soon as location services is turned on or it uses batter power whenever the location services is queried/used for a new location ?
The GPS starts working only when the location manager requests an update from it. Turning on the GPS in the device only allows programs to request locations if they want, but it doesn't mean the GPS is kicking in.
You can test it yourself: The GPS icon in the notification bar tells the GPS status. You can turn on the GPS, but the icon won't appear. Why? No application requests updates now. As soon as an application requests an update, the icon starts blinking (The GPS is initializing itself) and when it stops, it means the GPS is initialized and is currently receiveng updates.
The GPS consumes battery only when this icon appears.
My company wrote a blog post on this subject a while back. Check to see if its useful.
http://www.littleeye.co/blog/2013/03/29/understanding-gps-resource-usage/
But we missed talking about what happens when no app is actually requesting for a location update. And yes, as mentioned unless apps actually ask for a location update, they will not cause power drain. But note that even a single request for a location update (depending on coarse or fine grained request) can have unintended effects, as the device has to go thro various states before it can get back to its steady state.
Turning on location services is just permission given by user to applications for using location services. As long as any application not asks for location, power consumption is the same as with location sesrvices turnded on.
On the other hand - there is many applications trying to get location. Facebook, Camera, Android, many of ads libs, so yes - user can get battery life issues when GPS is unlocked.

Categories

Resources