Hi,
Long time ago I created an app that I'd like to upgrade.
But I'm already blocked at the 1st stage, I can't create the subfolders on the mobile (ideally in "/storage/emulated/0"
Here is the code I had in Starter:
I spend really long time on the "B4X Getting Started" & "B4X Basic Language" (chap 5.13.1.1.2) guides and on the forum (e.g. https://www.b4x.com/android/forum/threads/solved-file-dirrootexternal-and-runtimepermissions.90780/), but despite lot of trials, didn't solve it.
I also tried to create them on "File.DirDefaultExternal" (which could be an option for me, but less valuable), but was also unsuccessful.
Would someone be able to help me on this?
Thanks.
Fab
Long time ago I created an app that I'd like to upgrade.
But I'm already blocked at the 1st stage, I can't create the subfolders on the mobile (ideally in "/storage/emulated/0"
Here is the code I had in Starter:
Starters:
Sub Process_Globals
' Repertoire de stockage des données
Public EmplacementStockageSurDevice As String : EmplacementStockageSurDevice = File.DirRootExternal 'EmplacementStockageSurDevice : /storage/emulated/0
Public RepertoireRacine As String : RepertoireRacine = "/Toto App"
Public NomApplication As String : NomApplication = "/First App"
End Sub
Sub Service_Create
'___________________________________________________________________
'<<<======================
' ______________Création des Répertoires nécessaires sur le Device et copie des fichiers langues et du fichier ini_____________________________
' ==========================>>>
' Création des répertoires pour stocker la base de données, les photos et les fichiers langues si nécesaire
If File.Exists(EmplacementStockageSurDevice & RepertoireRacine & NomApplication & "/Pictures", "") = False Then
File.MakeDir(EmplacementStockageSurDevice, RepertoireRacine & NomApplication & "/Pictures")
End If
If File.Exists(EmplacementStockageSurDevice & RepertoireRacine & NomApplication & "/Data Base", "") = False Then
File.MakeDir(EmplacementStockageSurDevice, RepertoireRacine & NomApplication & "/Data Base")
End If
If File.Exists(EmplacementStockageSurDevice & RepertoireRacine & NomApplication & "/Language support files", "") = False Then
File.MakeDir(EmplacementStockageSurDevice, RepertoireRacine & NomApplication & "/Language support files")
End If
' Création du répertoires pour stocker les photos encryptées si nécesaire
If File.Exists(EmplacementStockageSurDevice & RepertoireRacine & NomApplication & "/tmp/Pictures/Zip", "") = False Then
File.MakeDir(EmplacementStockageSurDevice, RepertoireRacine & NomApplication & "/tmp" & "/Pictures" & "/Zip")
End If
' Création du répertoires pour stocker la base de données encryptées si nécesaire
If File.Exists(EmplacementStockageSurDevice & RepertoireRacine & NomApplication & "/tmp/Data Base/Zip", "") = False Then
File.MakeDir(EmplacementStockageSurDevice, RepertoireRacine & NomApplication & "/tmp" & "/Data Base" & "/Zip")
End If
' Création du répertoires pour stocker les pdf
If File.Exists(EmplacementStockageSurDevice & RepertoireRacine & NomApplication & "/PDFs", "") = False Then
File.MakeDir(EmplacementStockageSurDevice, RepertoireRacine & NomApplication & "/PDFs")
End If
End Sub
I spend really long time on the "B4X Getting Started" & "B4X Basic Language" (chap 5.13.1.1.2) guides and on the forum (e.g. https://www.b4x.com/android/forum/threads/solved-file-dirrootexternal-and-runtimepermissions.90780/), but despite lot of trials, didn't solve it.
I also tried to create them on "File.DirDefaultExternal" (which could be an option for me, but less valuable), but was also unsuccessful.
Would someone be able to help me on this?
Thanks.
Fab