Android Question Genymotion Emulator

Sergey_New

Well-Known Member
Licensed User
Longtime User
When using the app, an ini-file is created that stores the app's settings. What could have happened that the ini-file is now empty after closing and reopening the emulator? I've tried it on different emulators, but this hasn't happened before.
 

jkhazraji

Active Member
Licensed User
Longtime User
This worked for me:
B4X:
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
 
Upvote 0
Top