Reputation: 63
Im working on a phonegap/cordova project.Im trying to turn on or off in my app.I got code in native android app gps turn off and on.I dont know how to convert this in cordova/phonegap code.Is there any way to make gps on or off using cordova or phonegap.I used below link for native code: http://www.helloandroid.com/tutorials/calling-system-settings-android-app-gps-example
Upvotes: 2
Views: 5221
Reputation: 209
i just made a plugin that do that.
I hope you serve if so , remember to provide some feedback .
Upvotes: 7
Reputation: 319
You can create plugin in native code for your cordova project, in that plugin place gps on off code. Pass the parameter from JavaScript to this plugin, based on the parameter value on or off the GPS
some links where you can learn creating plugins
http://devgirl.org/2013/09/17/how-to-write-a-phonegap-3-0-plugin-for-android/
http://devgirl.org/2013/09/17/how-to-write-a-phonegap-3-0-plugin-for-android/
http://www.plotprojects.com/developing-a-cordova-phonegap-plugin-for-android/
Upvotes: 0