How to turn on and off gps using cordova or phonegap?

2,958 views
Skip to first unread message

Dev Sharma

unread,
Sep 18, 2014, 1:39:43 AM9/18/14
to phon...@googlegroups.com
Hi all,
I am trying to turn on/off gps setting using cordova/phonegap.I have gone through all the materials that are available on internet but no result.Only I got some comments on it.I have got some materials on for native android code and full source code also.The same question asked earlier also many times but someone has shared their experience on this.Below links provide some idea but not completely....
So,please if somebody has done anything on this,share his idea or experience..
Thanks in advance,

Steve Husting

unread,
Sep 18, 2014, 11:27:41 AM9/18/14
to phon...@googlegroups.com

Dev Sharma

unread,
Sep 19, 2014, 12:37:43 AM9/19/14
to phon...@googlegroups.com
Hello steve,
I have gone through your article but I have one question Are you able to turn on or off system gps setting using cordova/android code.
Thanks,

Ronald K

unread,
Sep 19, 2014, 6:20:48 AM9/19/14
to phon...@googlegroups.com
No, Cordova cannot change the user's system GPS settings. You'll need to kindly ask the user to do so himself.


Op donderdag 18 september 2014 07:39:43 UTC+2 schreef Dev Sharma:

Dev Sharma

unread,
Sep 19, 2014, 6:35:39 AM9/19/14
to phon...@googlegroups.com
Hello Ronald K,

Yes,I agree,but we can use javascript to access android native code to do.I am working on it.If you know about it,please share how to do so.Iam also working on it.Once its completed I will update here.
Thanks,

ABHISHEK BEDRE

unread,
Sep 19, 2014, 11:10:51 AM9/19/14
to phon...@googlegroups.com
Hey Guies,

Good News to all of you. Learn Different technologies free.


http://programming-guru.com/
http://youtube.com/WebBoostings
http://webboostings.blogspot.in/

Thank You
Abhishek Bedre

Kim Ras

unread,
Sep 19, 2014, 11:28:37 AM9/19/14
to phon...@googlegroups.com
Hi,
Remember that you can only enable and Disable the GPS, If the Security in the device allows it. If the user has not allowed your app to use Geolocation (iOS) or the GPS is not on all together. There is no way of changing that setting from code.. It is on the User to allow for the location service to be used. 
Anything else I would consider hacking ;-)

Regards
Kim

Steve Husting

unread,
Sep 19, 2014, 11:43:23 AM9/19/14
to phon...@googlegroups.com
Then I misunderstood your question. My article implements location and turning it on and off with buttons. It doesn't turn off the device's GPS, sorry.
Reply all
Reply to author
Forward
0 new messages