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.
Thanks! But this is just an emulator; the program still needs debugging.am comfortable with LDPlayer64
Did you save the .ini file in File.DirInternal (it's the same even if you use xui.DefaultFolder)?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.
SetApplicationAttribute(android:allowBackup, "true")
Reading the saved file:Did you save the .ini file in File.DirInternal
mapSettings = File.ReadMap(File.DirInternal, ProgName & ".ini")
Unfortunately, it didn't help.SetApplicationAttribute(android:allowBackup, "true")
The emulator of Android studio
Dim kvs As KeyValueStore
kvs.Initialize(xui.DefaultFolder,"kvs.data")
kvs.Put("data1","x1")
kvs.Put("data2","x2")
mapSettings = File.ReadMap(File.DirInternal, ProgName & ".ini")
LucaMs, thanks! How can I create a loop to get all the data?
For Each Key As String In kvs
Log(kvs.Get(Key))
Next
Sub Service_Start (StartingIntent As Intent)
Service.StopAutomaticForeground
If File.Exists(xui.DefaultFolder, "kvs.data")=False Then
Dim kvs As KeyValueStore
kvs.Initialize(xui.DefaultFolder,"kvs.data")
kvs.Put("data1","x1")
kvs.Put("data2","x2")
Else
readKVS
End If
End Sub
Sub readKVS
Dim strVariable As String
strVariable = kvs.Get("data1")
Log(strVariable)
End Sub
I made it, it doesn't work. Please see my example.You should make kvs a global variable