Android Question Deployment of assets / virtual_assets concept?


Licensed User
Longtime User
Hi ,

i have a B4A application with lots of html , js , images in my [Files] folder of my project.
and during deployment , i compiled the project under compilation mode "Release" + "Default" ,

then connected using B4A bridge , so after compiled , it will installed but when open , it will have
Error and the app cannot run at all ,

i check using Astro file explorer and goto the /sdcard/Andriod/data/com.mycompany.appname
and i found only my sqlite db was found in the files folder and NOTHING ELSE ,

then i recompiled the app under mode "Debug" + "Default" , and after it compiled , it will auto
install again and when i open it, this time the APP run properly ,

so i go to the folder in the mobile devices to check again, this time i found a NEW folder name "virtual_assets" was created inside the files folder , all my files that i previously put under my [Files] folder of my project is ALL there ,

as i am still not sure about the assets folder and the virtual_assets , so my questions are ,
  • why i got the Error when it is newly install /First time install ?
  • if i need the virtual_assets and all its files like the one it was created during my DEBUG run, how can i copy it from the ASSETS folder of the app ?
  • what are the other important notes before i deploy my APK ? ( because seems that my APP will not be able to deploy live as it needs me to get it run on debugger mode or to at lease connect with my B4A ide and run it once under Debug mode before it can be fully deploy.


Licensed User
Longtime User
Hi , i found that i do not need all the files in the virtual_assets at all , but i do require a folder which i need to write my dynamic files into ,
the folder are :
File.DirDefaultExternal & "/virtual_assets/common"
and i have put the following code under my Main activity , when the first time it installed , i expect it will create the folder and then run
the app continuously , which it did create the folder as expected but with an Error for the first run , the code as follow ,

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

'Create the SQLDataBasePath/virtual_assets/common folder
'ToastMessageShow( File.DirDefaultExternal, False )

If File.Exists( File.DirDefaultExternal, "/virtual_assets/common") = False Then
File.MakeDir (File.DirDefaultExternal & "/virtual_assets/common","")​
perhaps , the app run before the folder is been created ? Can anyone advice , thanks ?
Upvote 0