The original program (pre-starter service days) used File.DirRootExternal to store the database if it was available. I have no problem using File.DirInternal going forward given the size of most new phone's internal storage sizes.
The old code originally set the program's working folder in a "main" module at startup:
If File.ExternalWritable Then
WorkingFolder = File.DirRootExternal
Else
WorkingFolder = File.DirInternal
End If
And I just left that for the new version when I migrated the old code to the new starter service method. And that worked great the whole time I was in debug mode. Once I hit release mode testing, that's when the access error started.
Again, going forward, the new version can create a new folder in File.DirInternal and copy the new database from assets to there (this works fine). Where I'm getting the error is when I try to access the old version's database in File.DirRootExternal ("/storage/emualted/0/ProgramName/database_v01.db") that is when the EACCESS error is thrown.
I need to copy the old database to the new folder location and migrate the data to the new database then delete the copied version of the database. This means that I somehow need to know if the old version was using .DirRootExternal or .DirInternal and if external need privileges to read/write/delete.
And, ideally, I should delete the original database in the root external/internal folder (the whole folder preferably) as well if the migration was successful. This method works perfectly in debug mode.
What methodology do I need to use to accomplish this process in release mode and figure out where the old database resides?