I am testing my App on a device with Android 4.2.2 - SDK 17, but unfortunately when I run this code it goes into error.
With this code I get the error
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
With this code it works correctly
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
 return:
"/storage/emulated/0/Android/data/<packname>/files"
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
 return:
"/data/user/0/<packname>/files"
What can I do to manage this on some older devices?
			
			With this code I get the error
			
				B4X:
			
		
		
		Sub Process_Globals
    Public kvs As KeyValueStore
End Sub
Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        kvs.Initialize(rp.GetSafeDirDefaultExternal(""),"userconfig")
    End If
End SubWith this code it works correctly
			
				B4X:
			
		
		
		Sub Process_Globals
    Public kvs As KeyValueStore
End Sub
Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        kvs.Initialize(File.DirInternal,"userconfig")
    End If
End Sub
			
				B4X:
			
		
		
		rp.GetSafeDirDefaultExternal("")"/storage/emulated/0/Android/data/<packname>/files"
			
				B4X:
			
		
		
		File.DirInternal"/data/user/0/<packname>/files"
Error occurred on line: 12 (KeyValueStore)
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:341)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:238)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:515)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:207)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:178)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:875)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:843)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:671)
at anywheresoftware.b4a.sql.SQL.Initialize(SQL.java:44)
at refertionline.rbsoft.com.keyvaluestore._initialize(keyvaluestore.java:59)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at refertionline.rbsoft.com.main.afterFirstLayout(main.java:105)
at refertionline.rbsoft.com.main.access$000(main.java:17)
at refertionline.rbsoft.com.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5365)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
What can I do to manage this on some older devices?
 
				 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		