Sub Process_Globals
Dim rv As RemoteViews
Dim GPS1 As GPS
Dim tl As Toggle
Dim lat,lon,alt As Double
lat = 0
lon = 0
alt = 0
End Sub
Sub Service_Create
rv = ConfigureHomeWidget("Main_widget", "rv", 0, "MIMM SOS", True)
End Sub
Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then
Return
End If
End Sub
#Region Service
Sub Service_Destroy
End Sub
Sub rv_RequestUpdate
rv.UpdateWidget
End Sub
Sub rv_Disabled
StopService("")
End Sub
#End Region
#Region GPS
Sub gpsActive(Tim As Long, Dis As Float)
If GPS1.GPSEnabled = False Then <<<<<<<<<<<<< qui va in bomba cazzarola >>>>>>>
ToastMessageShow("GPS disabilitato.", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
End If
If GPS1 = Null Then
GPS1.Initialize("GPS")
tl.Initialize
End If
GPS1.Start(Tim,Dis)
End Sub
Sub GPS_LocationChanged (Location1 As Location)
lat = Location1.Latitude
lon = Location1.Longitude
alt = Location1.Altitude
Dim Sms As PhoneSms
Dim numerphone As Phone
Dim s As String
s = lat & "," & lon
s = Setting.mappaLink(s)
Sms.Send(Setting.xchiave3, "Richiesta di aiuto! sono qui " & s)
ToastMessageShow("SMS inviato correttamente...", True)
GPS1.Stop
End Sub
Sub GPS_UserEnabled (Enabled As Boolean)
ToastMessageShow("GPS device enabled = " & Enabled, True)
End Sub
Sub GPS_GpsStatus (Satellites As List)
' lblSatellites.Text = "Satellites:" & CRLF
' For i = 0 To Satellites.Size - 1
' Dim Satellite As GPSSatellite
' Satellite = Satellites.Get(i)
' lblSatellites.Text = lblSatellites.Text & CRLF & Satellite.Prn & _
' " " & Satellite.Snr & " " & Satellite.UsedInFix & " " & Satellite.Azimuth _
' & " " & Satellite.Elevation
' Next
End Sub
#End Region
#Region event click
Sub ImageView1_Click
StartActivity(Main)
End Sub
Sub Panel1_Click
StartActivity(Main)
End Sub
Sub ImageView6_Click ' ICE
Setting.FileSettingApp.SetString("chiave0","5")
StartActivity(Main)
End Sub
Sub ImageView5_Click ' 118
If Setting.xchiave4 = "empty" OR Setting.xchiave4 = Null OR Setting.xchiave4 = "" Then
ToastMessageShow("key not valid", False)
Setting.FileSettingApp.SetString("chiave0","4")
StartActivity(Main)
Return
End If
Dim p As PhoneCalls
StartActivity(p.Call(Setting.xchiave4))
End Sub
Sub ImageView4_Click ' Sms
If Setting.xchiave3 = "empty" OR Setting.xchiave3 = Null OR Setting.xchiave3 = "" Then
ToastMessageShow("key not valid", False)
Setting.FileSettingApp.SetString("chiave0","3")
StartActivity(Main)
Return
End If
gpsActive(0, 0)
ToastMessageShow("SMS in fase di localizzazione", True)
End Sub
Sub ImageView3_Click ' chiama
If Setting.xchiave2 = "empty" OR Setting.xchiave2 = Null OR Setting.xchiave2 = "" Then
ToastMessageShow("key not valid", False)
Setting.FileSettingApp.SetString("chiave0","2")
StartActivity(Main)
Return
End If
Dim p As PhoneCalls
StartActivity(p.Call(Setting.xchiave2))
End Sub
Sub ImageView2_Click ' navigatore
If Setting.xchiave1 = "empty" OR Setting.xchiave1 = Null OR Setting.xchiave1 = "" Then
ToastMessageShow("key not valid", False)
Setting.FileSettingApp.SetString("chiave0","1")
StartActivity(Main)
Return
End If
Dim s As String
s = Setting.xchiave1
Setting.mappa(s)
End Sub
#End Region