Android Question Base64 encode/decode image library error

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Hi, trying to test this library
Using a button and a text field to see the resulting blob2base64.
Im getting an error in the folowing code:
Sub btnVerBlob64_Click
    Log("Pasando " & TesteoPHP.ViendoImagen & " a base64")
    Dim B64Str As String = Base64Con.EncodeFromImage(File.DirDefaultExternal, TesteoPHP.ViendoImagen)
    txtBlob64.Text = B64Str
End Sub
TesteoPHP.ViendoImagen is the mage name and it really exists.

The error is :
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String anywheresoftware.b4a.objects.StringUtils.EncodeBase64(byte[])' on a null object reference