0

I'm developing an app on Android and I'm trying to use this app for location mock on Android 6.0.1 (physical device).

The app consists on a webview that renders some page which contains Google Maps.

I have enabled the mock location app under SettingsDeveloper OptionsMock Location App, which works fine with the Google Maps app on the phone, but it doesn't on my app.

In fact I've tried debugging using remote devices and the geolocation object of HTML5 doesn't seem to exist when I use the mock location app, but it DOES when I don't.

I've also read that sometimes you need to turn Wi-Fi off, because it tries to mock location, but it snaps back to the location the Wi-Fi provides. Thing is I need the data 'on' because of my app.

Also tried using Google Maps inside the Chrome app (on my phone), which also doesn't work with the mock.

As a side note: It was tested before and after rooted my device, but nothing changed. It was developed using Xamarin Forms.

I tried GPS modes 'high accuracy' and 'gps only' to not avail.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
maxter404
  • 1
  • 2
  • 1
    Make sure that the Location setting on the device is set to use GPS only, on Nexus devices this option is called `Device only`. This will prevent any app from getting location locks using WiFi. – Daniel Nugent Aug 10 '17 at 19:04
  • Thank you for your suggestion but the problem persists – maxter404 Aug 10 '17 at 19:32
  • 1
    Looks like chrome might do something that prevents mock locations in web apps, see here: https://stackoverflow.com/questions/39214630/mock-gps-location-and-chrome-for-android – Daniel Nugent Aug 10 '17 at 21:16
  • @DanielNugent that seems to be the case, I've tried with firefox and it mocks the location, both in maps and my app. I was hoping that there will be a workaround, but sadly it doesn't seem so. Thanks! and I'd love to upvote you (if i had enough reputation) – maxter404 Aug 10 '17 at 23:06

0 Answers0