Hello,
I'm trying to update an app developed in 2016.
Today issue: I collect data's that need to be added into my local database. Issue is that instead adding the data's into the local data base, it creates a new temporary file
NB: I want my app to save files into "File.DirRootExternal" => in the manifest, I have "<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>" and I'm clear that my app will never be shared on Google Play.
The was I proceed:
Would someone know what is wrong ?
Main difference vs my 2016 app version is that database transfer from Dir Asset to the device is done in "Main" instead "Starter" (link).
Have a nice week-end
Fab
I'm trying to update an app developed in 2016.
Today issue: I collect data's that need to be added into my local database. Issue is that instead adding the data's into the local data base, it creates a new temporary file
NB: I want my app to save files into "File.DirRootExternal" => in the manifest, I have "<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="28"/>" and I'm clear that my app will never be shared on Google Play.
The was I proceed:
In main, I create all folders and subfolders needed'In starter
Public SQL1 As SQL
Public NomBaseDeDonnees As String : NomBaseDeDonnees = "InventaireLogement.db"
Public NomBaseDeDonneesDeSupport As String : NomBaseDeDonneesDeSupport = "InventaireLogement.db"
'Reference database is stored in DirAsset
In main, I copy my database from DirAsset (if needed) and initialize the databaseAs example:
If File.Exists(Starter.EmplacementStockageSurDevice & Starter.RepertoireRacine & Starter.NomApplication & "/Data Base", "") = False Then
File.MakeDir(Starter.EmplacementStockageSurDevice, Starter.RepertoireRacine & Starter.NomApplication & "/Data Base")
End If
In another activity module (AjoutEdit), I collect all my data's into several variables and try to add them in my databaseDim rp As RuntimePermissions
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result Then
If File.Exists(Starter.RepertoireStockageBaseDeDonnees, Starter.NomBaseDeDonnees) = False Then
File.Copy(Starter.RepertoireStockageBaseDeDonneesDeSupport, Starter.NomBaseDeDonneesDeSupport, Starter.RepertoireStockageBaseDeDonnees, Starter.NomBaseDeDonnees)
Starter.SQL1.Initialize(Starter.RepertoireStockageBaseDeDonnees, Starter.NomBaseDeDonnees, True)
Else
Starter.SQL1.Initialize(Starter.RepertoireStockageBaseDeDonnees, Starter.NomBaseDeDonnees, True)
End If
End If
Starter.SQL1.ExecNonQuery2("INSERT INTO Inventaire VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", _
Array As Object(PieceSelectionnee_rowID, DescriptionDeLObjet, MarqueDeLObjet, ModelDeLObjet, CategorieSelectionnee_rowID, DateDAchatDeLObjet, LieuDAchatDeLObjet, PrixDeLObjet, PhotoTaken(0), PhotoTaken(1), PhotoTaken(2), PhotoTaken(3), PhotoTaken(4), Starter.CodeBarre))
Would someone know what is wrong ?
Main difference vs my 2016 app version is that database transfer from Dir Asset to the device is done in "Main" instead "Starter" (link).
Have a nice week-end
Fab