Android Question Decode & decompress to get from php json to B4A, i need the inverse

scsjc

Well-Known Member
Licensed User
Longtime User
Hello, i have a code and get from web php:

B4X:
    $gzdata = base64_encode(gzcompress(json_encode($return_arr)));
    echo $gzdata;

And decode into APP with B4A with that:

B4X:
Sub decode(texto As String) As String
    Dim strResult As String
    Dim cs As CompressedStreams   
    Dim su As StringUtils
    Dim bt() As Byte
    Dim bc As ByteConverter
    Try
        bt = su.DecodeBase64(texto)
        bt = cs.DecompressBytes(bt, "zlib")
        strResult = bc.StringFromBytes(bt, "UTF8")
        Return strResult
    Catch
        Log(LastException)
        Return ""
    End Try
End Sub


Can help me to make a inverse proces ??? Make A:

B4X:
Sub encode(texto As String) As String
...


Thanks !!!
 
Top