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.
 

DonManfred

Expert
Licensed User
Longtime User
Ask Genymotion support for help with Genymotion
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
Refusal of assistance with reference to the rules:
2.5 Personal Use – Genymotion Desktop
...
By selecting “Personal Use”, End-Users agree not to receive any technical assistance from Genymobile.
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
I uninstalled and reinstalled Genymotion and the emulators. Nothing changed.
 
Upvote 0

LucaMs

Expert
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.
Did you save the .ini file in File.DirInternal (it's the same even if you use xui.DefaultFolder)?

The following setting affects app installation and uninstallation, but you can try it anyway.
In the manifest file:
B4X:
SetApplicationAttribute(android:allowBackup, "true")
Make sure the value is true.
 
Upvote 0

jkhazraji

Active Member
Licensed User
Longtime User
Try disabling emulator quick-boot. In Android Studio emulator:
B4X:
emulator -avd <Your_AVD_Name> -no-snapshot
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
I'm trying to change the application settings storage method and use KVS instead of Map.
B4X:
Dim kvs As KeyValueStore
kvs.Initialize(xui.DefaultFolder,"kvs.data")
kvs.Put("data1","x1")
kvs.Put("data2","x2")
How can I now retrieve stored data from DefaultFolder?
With Map, it was easy:
B4X:
mapSettings = File.ReadMap(File.DirInternal, ProgName & ".ini")
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
LucaMs, thanks! How can I create a loop to get all the data?
 
Upvote 0

Sergey_New

Well-Known Member
Licensed User
Longtime User
I'm probably doing something wrong. I'm getting the error java.lang.RuntimeException: Class instance was not initialized (keyvaluestore)
Starter:
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
 
Upvote 0

jkhazraji

Active Member
Licensed User
Longtime User
-Use try..catch to pinpoint the exact error.
-If the conditional statement branches to ReadKVS, kvs should be initialized there also or
-Make it global as you've been advised and initialize it in Activity_Create
 
Upvote 0
Top