Android Question FusedLocationProvider with tracker service

Mostez

Well-Known Member
Licensed User
Longtime User
I want to make driver/vehicle tracking application, and I want to base my application on Erel's tracker-example
is there any code example to use FusedLocationProvider with tracker service?

TIA
 

Mostez

Well-Known Member
Licensed User
Longtime User
I ran MyLocation example and went to location settings as in attached screenshot, my question now is, as long as the device is using GPS, Wi-Fi and mobile networks in GPS tracking example (just like FLP), what is the real difference between GPS and FLP? sorry got confused!
 

Attachments

  • Screenshot_20210531-103110.png
    Screenshot_20210531-103110.png
    86 KB · Views: 251
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
FLP is a servce from Google and you need have a acount (99.9% of persona use Android with one acount).
GPS only is a library.
FLP run into a closed site (into house or simil). FTP no.

FLP: The user need accept Android a location in Android.
GPS: The use need accept a permision for the APP

FLP use wifi and all thecnology from Google. GPS only Satellite (i think).

In your app you must check 2 elements: LOCATION Activate (FOR FLP) and Permision GPS

A have a form (activity) for check the 2 elements: (and check other requeriments, in 4 buttons)

B4X:
Private Sub cmdPermiso4_Click
    'MsgboxAsync("Se solicitará permiso para GPS y Localización.","PERMISSION_ACCESS_FINE_LOCATION")
    'MsgboxAsync("Se solicitará permiso para GPS y Localización. Por ejemplo, se detectará la posición en el alta de un parte.","PERMISSION_ACCESS_FINE_LOCATION")
    'wait for MsgBox_Result(Rt As Int)

    Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    
    
    

        
    flp.Initialize("flp")
    flp.Connect


    Dim rs As ResumableSub = CheckLocationSettingStatus
    Wait For (rs) Complete (SettingsResult As LocationSettingsResult)
    Dim sc As StatusCodes
    Select SettingsResult.GetLocationSettingsStatus.GetStatusCode
        Case sc.SUCCESS
            'SettingsAreGood
        Case sc.RESOLUTION_REQUIRED
            'SetState("RESOLUTION_REQUIRED")
            SettingsResult.GetLocationSettingsStatus.StartResolutionDialog("srd")
            Wait For srd_ResolutionDialogDismissed(LocationSettingsUpdated As Boolean)
            If LocationSettingsUpdated Then
            '    SettingsAreGood
            Else
            '    SetState("No disponible")
            End If
        Case Else
            'SetState("No disponible")
    End Select
    
    
    

    Permisos
End Sub


private Sub Permisos
    cmdPermiso1.Enabled = Not( Starter.rp.Check(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE))
    cmdPermiso2.Enabled = Not( Starter.rp.Check(Starter.rp.PERMISSION_CALL_PHONE))
    cmdPermiso3.Enabled = Not( Starter.rp.Check(Starter.rp.PERMISSION_CAMERA))
    cmdPermiso4.Enabled = Not( Starter.rp.Check(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION))
    

    Dim p As Phone
    Dim T As String
    t = p.GetSettings ("location_providers_allowed")
    If t = "" Then
        cmdPermiso4.Text = "*Localización no activada"
        cmdPermiso4.Enabled = True
    Else
        cmdPermiso4.Text = "Localización (" & t & ")"
    End If

    
End Sub
 
Upvote 0
Top