Android Question GPS is started or not

Discussion in 'Android Questions' started by Scantech, Aug 1, 2019.

  1. Scantech

    Scantech Well-Known Member Licensed User

    Hello,

    How can i know if the GPS is started or not? I know GPS1.GPSEnabled is for location turned on or off but i like to find out if it is started.
     
  2. emexes

    emexes Well-Known Member Licensed User

    Hmm. Good question. If you are receiving location callbacks, that'd be a start. Or perhaps properties like these:

    upload_2019-8-2_2-51-58.png

    upload_2019-8-2_2-52-13.png

    That UsedInFix property looks promising too - just because the GPS can see a satellite and give you a SNR, doesn't mean it's yet got valid fixes.
     
  3. Scantech

    Scantech Well-Known Member Licensed User

    Code:
    Sub GPS_LocationChanged (Location1 As Location)
        locationGPS = Location1
    End Sub
    That did not work.

    The value is true when GPS1.Start(0, 0) and also the value is true when GPS1.Stop.

    There is got to be a way.
     
  4. Scantech

    Scantech Well-Known Member Licensed User

    I guess this is the only way as per Erel example
    Code:
    Public Sub StartGps
        
    If gpsStarted = False Then
            GPS1.Start(
    00)
            gpsStarted = 
    True
        
    End If
    End Sub
    Public Sub StopGps
        
    If gpsStarted Then
            GPS1.Stop
            gpsStarted = 
    False
        
    End If
    End Sub
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice