Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Private xui As XUI
    Private kvs As KeyValueStore
End Sub
Sub Service_Create
    'This is the program entry point.
    'This is a good place to load resources that are not specific to a single activity.
End Sub
Sub Service_Start (StartingIntent As Intent)
    Service.StopAutomaticForeground
    If File.Exists(xui.DefaultFolder, "kvs.data")=False Then
   
        kvs.Initialize(xui.DefaultFolder,"kvs.data")
        kvs.Put("data1","x1")
        kvs.Put("data2","x2")
    Else
        readKVS
    End If
End Sub
Sub readKVS
    kvs.Initialize(xui.DefaultFolder,"kvs.data")
    Dim strVariable As String
    strVariable = kvs.Get("data1")
    Log(strVariable)
End Sub