Android Question How to save files in DirAssets

In my project I'm getting long blob from MySQL DB and decode Base64 by using,

B4X:
buffer1=su1.DecodeBase64(rs.GetString("image"))

then I use this code,

B4X:
Sub BytesToFile (Dir As String, FileName As String, Data() As Byte)

    Dim out As OutputStream = File.OpenOutput(Dir, FileName, False)

    out.WriteBytes(Data, 0, Data.Length)

    out.Close

    ProgressDialogHide

End Sub

and call BytesToFile(File.DirAssets,rs.GetString("product_name") & ".png",buffer1) to save image file in dirassets. I'm getting Error for this.

The reason why I'm saving images in dirAssets is I'm using BCTextEngine library and need to call image by using [img FileName="logo.png" width=50/]

Is there anyway to save files in dirAssets or any other way to call images in BCTextEngine (DirInternal or DirRootExternal)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…