GPS icon when using geolocation is not active


I’m trying use two functions on my device Samsung Galaxy S2, Android 4.4.2.

    $scope.getCurrentLocationNavi = function() {         
        currentLongLat = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
        }, function(err){
             enableHighAccuracy: true,
             timeout: 1200000,
             maximumAge: 2000

    $scope.getCurrentLocationCordova = function()
        var watchOptions = {
          frequency : 1000,
          timeout : 3000,
          enableHighAccuracy: false // may cause errors if true

        var watch = $cordovaGeolocation.watchPosition(watchOptions);

        watch.then(function(position) {
         currentLongLat = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
          alert('assigning your new position');

        }, function(error) {
            alert('Error w/ watchPosition: ' + +JSON.stringify(error));

Neither are working, first function works only on my pc, but on device any of those. I also notice that they don’t try to call gps mechanism, because icon responsible for that is not showing. To comparison I open “Endomondo” and immidiately icon is showing and gps see my location.

Is Ionic appropriate for this type of app using maps?


No one can help? Is this geolocation works on yours devices? If yes, gps icon is active when searching location?


I can’t test my app now but I find next step to checkout.


Maybe I should add some permisionss for device like:

 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
2. Maybe I should try crosswalk project on top of Ionic? I don't know if is compatible with the lastest Ionic version.


Added permissions but seems to not solving my issue.

I also notice strange think. My index.html has:

<script src="lib/ngCordova/dist/ng-cordova.js" type="text/javascript" />

<script src="cordova.js"></script>

and code:

 if($window.cordova) { // window.cordova also checked
 { // here I am }

Strange :frowning:


Ok, When I delete ngCordova, then I can enter into $window.cordova. Is this possible to use both ngCordova.js and cordova.js? I assume ‘cordova.js’ is fixed for ionic to enable working on device. So my question is, can I use ngCordova for my geolocation, and cordova.js to bootstrap app? Please can anybody say something?


Yea its third day on this issue… and you know what? Cordova geolocation is not working on samsung galaxy II, III etc…!topic/phonegap/ESrHAjFHgFU

What the hell?


Is there any other option to run geolocalisation without using “navigator.geolocation.”?


is the geolocation permission in your config file ?


In config.xml I added:

  <preference name="android-permission" value="ACCESS_FINE_LOCATION">

In …/platforms/android/AndroidManifest.xml I have at the bottom:

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />


this is what i used when i was working on a geo app for work


Thanks for your answers, really appreciate commitment.

This settings don’t fix this issue. I think it just not working and never been/will. Of course this is issue with Samsungs and android (4.1, 4.2, 4.4) and native browser. So I have to reject using Ionic (cordova) for that project. I will back when I have another one. But for geolocation purposes is not working, I can’t tell to the client, some phones will be working OK, some not. It just like slapping in the face… Use proper tool to proper problem -> so I go to “native”.


did you try installing crosswalk ??

ionic browser add crosswalk


It’s doable… i’m not using the watch geolocation plugin though. i’m using this: org.apache.cordova.geolocation
Then the script i use to watch the location is:

var mainloop;

$scope.startloop = function(){
	if (angular.isDefined(mainloop) ) return;
	mainloop = $interval(function(){
		var options = {
			enableHighAccuracy: true,
			maximumAge: 0,
			timeout: 10000
		$cordovaGeolocation.getCurrentPosition(options).then(function (pos) {
			latlong =  { 'lat' : pos.coords.latitude, 'long' : pos.coords.longitude };
			$rootScope.currentLocation = latlong;
		}, function(err) {});

$scope.stoploop = function(){
	if (angular.isDefined(mainloop)) {
		mainloop = undefined;

$scope.$on('$destroy', function() {
	// Make sure that the interval is destroyed too

Hope this helps :slight_smile:


Hi! This is incredible! It’s working, cmon :smile: So, this all issue with samsung galaxy is about first method invocation, its hanging. If we use time interval to do it again it’s start working. Huuuge thanks for yours help!


No I didn’t yet. Issue is now solved by @sjerd.

But I will try update my app to crosswalk (but have to create new with cordova 3.6 - to the newest crosswalk version 12) because I read that this help older android devices to manage the same features. It’s like jquery in js I think.

Thanks for help!


Use plugin sk.tamex.locationandsettings

my code:

you can only call when you are sure that GPS is enabled, if not you will have an app that could not get over the location to restart the app


Cannot call method ‘isGpsEnabled’ of undefined, i am getting this error for the plugin sk.tamex.locationandsettings

any help will be appriciated my code

var gpsEnabled = window.plugins.locationAndSettings;
$log.debug(‘gps enabled’+gpsEnabled)
gpsEnabled.isGpsEnabled(function(result) {



You don’t need to use interval. Instead you should initialize Geolocation in device ready event:

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {


and it should work like a charm. Working example can be found here: Using Cordova Geoloacation API with Google Maps in Ionic Framework