'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim rv As RemoteViews
Dim ST As SQL
Dim Cursor As Cursor
End Sub
Sub Service_Create
'Set the widget to update every 60 minutes.
rv = ConfigureHomeWidget("WidgetLayout", "rv", 60, "NameofWidget")
ST.Initialize(File.DirDefaultExternal, "Database.sql", False)
End Sub
Sub Service_Start (StartingIntent As Intent)
If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub
Sub Service_Destroy
End Sub
Sub rv_RequestUpdate
SetText
rv.UpdateWidget
End Sub
Sub SetText
rv.SetText("Label1", ST.ExecQuerySingleResult("SELECT count(*) FROM Database") & " Entries")
End Sub
Sub rv_Disabled
StopService("")
End Sub