tanhatarin tanha
tanhatarin tanha

Reputation: 93

phonegap Geolocation without WiFi and mobile network

I am developing an application using Phonegap for Android and use its geolocation method. This only works when mobile network or WiFi are available. I would like to use geolocation without these being available. Is this possible?

Upvotes: 5

Views: 2505

Answers (2)

DaveAlden
DaveAlden

Reputation: 30356

If you want Android to use the GPS receiver on the device, you need to set the "enableHighAccuracy" option when setting up the watcher in you Phonegap app:

navigator.geolocation.watchPosition(onSuccess, onError, { enableHighAccuracy: true });

Then you will be able to obtain a location without relying on Wifi or mobile network.

Upvotes: 3

carsol
carsol

Reputation: 353

You can not get the location of your device without a data connection (mobile network and/or Wifi). If you DO have a data connection and you have the proper location permission in your manifest file, you will get the geolocation. Am I understanding the question correctly?

Upvotes: -1

Related Questions