Share My Creation GPService 2.0 (.apk)

Hello all!
Today another application that I would like to share - GPService 2.0

Classically uses a GPS signal to determine your location.
During operation, the information is saved to * .GPX files,
- After getting the exact position (fix accuracy up to 100 meters) you can go
to external application OsmAnd +.
- the last fix is stored in the file (settings.dat)

B4X:
Sub Service_Start (StartingIntent As Intent)
    Try
        UpdateStatus (True, True)
        StartServiceAt("", DateTime.Now + 15 * 1000, True) 'will start after 15 seconds.
        'S e r v i c e Turning GPS ON
        GPS1.Start(0, 0) 'Listen to GPS with no filters.
     Catch
        '_ERROR Notification("E R R O R" & CRLF & LastException.Message)
        CancelScheduledService(Service)
    End Try
End Sub

Sub OsmandPlus
    Dim i,a As Intent
    Dim Pm  As PackageManager
    Dim Uri As String
    Dim LATs As String = ""
    Dim LONs As String = ""

    'geo:latitude,longitude
    'geo:latitude,longitude?z=zoom
    'geo:0,0?q=my+street+address
    'geo:0,0?q=business+near+city

    Try
        ServiceTurningGPS_OFF
        If nLATs.Text.Length > 0 And nLONs.Text.Length > 0 Then
            LATs = nLATs.Text.SubString2(2,9)
            LONs = nLONs.Text.SubString2(2,9)
            i = Pm.GetApplicationIntent("net.osmand.plus") : Uri = "geo:"&LATs&","&LONs&"?z=16"
            a.Initialize(i.ACTION_VIEW,  Uri)
   
            StartActivity(a)
            If a.IsInitialized Then AllowOsmand = True
            If AllowOsmand Then '_INFO Notification("S e r v i c e Turning GPS OFF")
        Else
            AllowOsmand = False
            '_WARNING Notification("E R R O R - geo: <none>")
        End If
    Catch
        '_ERROR Notification("E R R O R" & CRLF & "Program at the moment he could not be run")
    End Try
    ExitApplication
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("...")
    If File.Exists(SavedFilePath, SavedFileName) Then
        Try
        '    restore the saved geolocation
            Dim RandomAccessFile1 As RandomAccessFile
            RandomAccessFile1.Initialize(SavedFilePath, SavedFileName, True)
            LtDouble  = RandomAccessFile1.ReadDouble(0)
            LgDouble  = RandomAccessFile1.ReadDouble(RandomAccessFile1.CurrentPosition)
            Accuracy  = RandomAccessFile1.ReadDouble(RandomAccessFile1.CurrentPosition)
            Languages = RandomAccessFile1.ReadDouble(RandomAccessFile1.CurrentPosition)
            RandomAccessFile1.Flush
            RandomAccessFile1.Close
        Catch
            ...
        End Try
        ...
    End If
End Sub
 

Attachments

  • Screenshot_2017-01.png
    Screenshot_2017-01.png
    242.9 KB · Views: 3,019
  • Screenshot_2017-02.png
    Screenshot_2017-02.png
    7 KB · Views: 448
  • Screenshot_2017-10-26-16-23-27.png
    Screenshot_2017-10-26-16-23-27.png
    391.7 KB · Views: 293
  • Screenshot_2017-10-26-16-23-43.png
    Screenshot_2017-10-26-16-23-43.png
    348.1 KB · Views: 396
  • Screenshot_2017-11_1.png
    Screenshot_2017-11_1.png
    112.5 KB · Views: 292
  • Screenshot_2017-11_2.png
    Screenshot_2017-11_2.png
    391.4 KB · Views: 297
  • GPService.apk
    449.8 KB · Views: 291
Last edited:
Top