Hi,
tell us why you want to use a base64 string
Just because it´s possible and i dont need to check for files. Before i use a file i need to verify the file is there. Depend on the type of the file i need also a checksum to verify the file i see is the file i expect. When I put it in the code, it's relatively safe, so my thought.
never put data inside your code
Okay, i´ve seen that the enviroment stop responding after insert the base64-String. I did not expect these, because it´s not so big. But ok, if you know it you can handle it...
Back to the main - i try to build a function to load the files...
Dim bmp As B4XBitmap=loadBitmapSecure("ImageFile.png")
Sub loadBitmapSecure(filename As String) As B4XBitmap
If File.Exists(File.DirAssets,filename)=True Then
Return xui.LoadBitmap(File.DirAssets,filename)
Else
If(filename.EqualsIgnoreCase("filenotfound.png"))=True Then
Log("FATAL: fileNotFound Image not found")
ExitApplication
End If
Log("file not found: " & filename)
Return loadBitmapSecure("fileNotFound.png")
End If
End Sub
The called file exists, the fileNotFound.png exists - but file.Exists returns false. Why? Is DirAssets a "real" folder, or is it inside the app packed as a kind of "virtual folder"? That would solve the problem by itself...