Hi,
In my current app I am storing a SQLite database in File.DirDefaultExternal.
In my next app release, I plan to set the TargetSDK to API 26 which will require me to use runtime permissions. Currently in my released version it's using API 16.
Since users already have my app installed, and the file is stored in DirDefaultExternal, it will require the user to accept the permission or have they already accepted the permission since they have the app installed from when it was API 16 ?
I am planning to move the database file to File.DirInternal so I was going to do something like the following as soon as the app runs (maybe from the starter service?):
Is the above code the best way in moving the database from the old location (DirDefaultExternal) to the new location (DirInternal) providing that the user has access to that location ?
In my current app I am storing a SQLite database in File.DirDefaultExternal.
In my next app release, I plan to set the TargetSDK to API 26 which will require me to use runtime permissions. Currently in my released version it's using API 16.
Since users already have my app installed, and the file is stored in DirDefaultExternal, it will require the user to accept the permission or have they already accepted the permission since they have the app installed from when it was API 16 ?
I am planning to move the database file to File.DirInternal so I was going to do something like the following as soon as the app runs (maybe from the starter service?):
B4X:
Dim rp As RuntimePermissions
If rp.Check(rp.PERMISSION_WRITE_EXTERNAL_STORAGE) = True Then
If File.Exists(File.DirDefaultExternal, "MyDatabase.db") Then
File.Copy(File.DirDefaultExternal,"MyDatabase.db",File.DirInternal,"MyDatabase.db")
End If
End If
Is the above code the best way in moving the database from the old location (DirDefaultExternal) to the new location (DirInternal) providing that the user has access to that location ?