Android Question Get New_Data as String

Discussion in 'Android Questions' started by Sinan Tuzcu, Feb 10, 2019.

  1. Sinan Tuzcu

    Sinan Tuzcu Active Member Licensed User

    Helo,

    is it possible to get New Data from AStreams_NewData as String and not Byte?

    I have try like below, but doesn't works. I get only an Error msg.

    Code:
    Sub AStreams_NewData (Buffer As String)
        
    Dim msg As String

        
    End Sub
     
  2. walterf25

    walterf25 Well-Known Member Licensed User

    You can use the AsyncStreamText Class instead
    https://www.b4x.com/android/forum/t...eful-when-working-with-streams-of-text.27002/

    Regards,
    Walter
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Watch the video tutorials. They explain these things.

    Generally speaking, you can convert an array of bytes to a string with:
    Code:
    Dim msg As String = BytesToString(Data, 0, Data.Length, "utf8")
    It is likely that AsyncStreamsText is better for your use case.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice