Dec 7, 2010 Replies: 78 It's occasionally useful to be able to poke around in things as arrays of bytes so this library lets you do it. It can transform arrays of primitive types to and from arrays of bytes with the "endian-ness" of the conversion specified. If you need endian-ness you will either know about it or rather quickly find out. Byte arrays can be transformed to and from a hexadecimal string representation. Strings can be transformed to and from arrays of Bytes using specified encodings and to and from arrays of Chars. An array copy method is thrown in for good measure. EDIT :- Version 1.1 posted. See post #4 for details. Download link: www.b4x.com/android/files/ByteConverter1.1.zip Last edited by a moderator: Dec 15, 2015 Click to expand...
It's occasionally useful to be able to poke around in things as arrays of bytes so this library lets you do it. It can transform arrays of primitive types to and from arrays of bytes with the "endian-ness" of the conversion specified. If you need endian-ness you will either know about it or rather quickly find out. Byte arrays can be transformed to and from a hexadecimal string representation. Strings can be transformed to and from arrays of Bytes using specified encodings and to and from arrays of Chars. An array copy method is thrown in for good measure. EDIT :- Version 1.1 posted. See post #4 for details. Download link: www.b4x.com/android/files/ByteConverter1.1.zip
Erel B4X founder Staff member Licensed User Longtime User Jan 14, 2016 #62 Can you upload a small project that doesn't work for you?
rasaliad Member Licensed User Longtime User Mar 31, 2016 #63 Hi, i want to test the RDC demo: Install de ByteConverter Lib in a AddLibs folder and add this path to B4A, the Lib is checked in the libraries tab. I open the ByteConverter Demo then when compile get the following error: I'm using the B4A V5.8 Trial Version The Javac.exe path is: C:\Program Files\Java\jdk1.8.0_77\bin\javac.exe *** Remote compilation mode *** B4A version: 5.80 Parsing code. (0.00s) Compiling code. (0.10s) Compiling layouts code. (0.00s) Compiling debugger engine code. (1.12s) Sending data to remote compiler. Error step: Compiling generated Java code. javac 1.7.0 src\anywheresoftware\b4a\agraham\byteconverter\main.java:344: error: cannot find symbol public static anywheresoftware.b4a.agraham.byteconverter.ByteConverter _conv = null; ^ symbol: class ByteConverter location: package anywheresoftware.b4a.agraham.byteconverter 1 error Then i open the RemoteServerClient Demo, the ByteConverter Lib is installed (Both files, .jar and .xml) in the Addlibs Folder. When complie get this error: *** Remote compilation mode *** B4A version: 5.80 Parsing code. (0.07s) Compiling code. (0.19s) Compiling layouts code. (0.01s) Compiling debugger engine code. (1.79s) Sending data to remote compiler. Error step: Compiling generated Java code. javac 1.7.0 src\b4a\example\dbrequestmanager.java:71: error: package anywheresoftware.b4a.agraham.byteconverter does not exist public anywheresoftware.b4a.agraham.byteconverter.ByteConverter _bc = null; ^ 1 error What i'm doing wrong? Thanks in advnaced, Rafael Liriano
Hi, i want to test the RDC demo: Install de ByteConverter Lib in a AddLibs folder and add this path to B4A, the Lib is checked in the libraries tab. I open the ByteConverter Demo then when compile get the following error: I'm using the B4A V5.8 Trial Version The Javac.exe path is: C:\Program Files\Java\jdk1.8.0_77\bin\javac.exe *** Remote compilation mode *** B4A version: 5.80 Parsing code. (0.00s) Compiling code. (0.10s) Compiling layouts code. (0.00s) Compiling debugger engine code. (1.12s) Sending data to remote compiler. Error step: Compiling generated Java code. javac 1.7.0 src\anywheresoftware\b4a\agraham\byteconverter\main.java:344: error: cannot find symbol public static anywheresoftware.b4a.agraham.byteconverter.ByteConverter _conv = null; ^ symbol: class ByteConverter location: package anywheresoftware.b4a.agraham.byteconverter 1 error Then i open the RemoteServerClient Demo, the ByteConverter Lib is installed (Both files, .jar and .xml) in the Addlibs Folder. When complie get this error: *** Remote compilation mode *** B4A version: 5.80 Parsing code. (0.07s) Compiling code. (0.19s) Compiling layouts code. (0.01s) Compiling debugger engine code. (1.79s) Sending data to remote compiler. Error step: Compiling generated Java code. javac 1.7.0 src\b4a\example\dbrequestmanager.java:71: error: package anywheresoftware.b4a.agraham.byteconverter does not exist public anywheresoftware.b4a.agraham.byteconverter.ByteConverter _bc = null; ^ 1 error What i'm doing wrong? Thanks in advnaced, Rafael Liriano
Erel B4X founder Staff member Licensed User Longtime User Mar 31, 2016 #64 You should use the full version instead of the trial version.
rasaliad Member Licensed User Longtime User Mar 31, 2016 #65 Erel said: You should use the full version instead of the trial version. Click to expand... Hi, I just buy the upgrade, but I do it with the following email to use paypal, how can you match this upgrade to may account? Thanks Rafael Liriano Last edited by a moderator: Apr 1, 2016
Erel said: You should use the full version instead of the trial version. Click to expand... Hi, I just buy the upgrade, but I do it with the following email to use paypal, how can you match this upgrade to may account? Thanks Rafael Liriano
Erel B4X founder Staff member Licensed User Longtime User Apr 1, 2016 #66 Please contact [email protected].
rasaliad Member Licensed User Longtime User Apr 1, 2016 #67 Erel said: Please contact [email protected]. Click to expand... Thanks Erel, I get the answer via email. Now let's work!!!!
Erel said: Please contact [email protected]. Click to expand... Thanks Erel, I get the answer via email. Now let's work!!!!
engvidal Member Licensed User Longtime User Aug 24, 2016 #68 I am trying to use the ByteConverter lib to send a message using the mqtt library. The publish needs the message to be in array of bytes. I tried: Code: Dim MyMessage As String = "Hi" Dim bc As ByteConverter Dim pack() As Byte = bc.StringToBytes(MyMessage,"UTF8") mqtt.Publish(mytopic, pack); // error !! but there is an error. Can anyone help ?
I am trying to use the ByteConverter lib to send a message using the mqtt library. The publish needs the message to be in array of bytes. I tried: Code: Dim MyMessage As String = "Hi" Dim bc As ByteConverter Dim pack() As Byte = bc.StringToBytes(MyMessage,"UTF8") mqtt.Publish(mytopic, pack); // error !! but there is an error. Can anyone help ?
DonManfred Expert Licensed User Longtime User Aug 25, 2016 #69 engvidal said: but there is an error. Click to expand... Syntax error? Filenotfound? Runtimeexception? We CANT help if you dont tell us which error you get exactly!!!
engvidal said: but there is an error. Click to expand... Syntax error? Filenotfound? Runtimeexception? We CANT help if you dont tell us which error you get exactly!!!
engvidal Member Licensed User Longtime User Aug 26, 2016 #70 Hi. I found the error. Just a typing mistake, BUT I have another problem, now receiving messages: Using this sub: Code: Private Sub mqtt_MessageArrived (Topic As String, Payload() As Byte) Dim obj As Object = serializator.ConvertBytesToObject(Payload) Dim s As String = obj Label2.Text = s End Sub Just at start up (and after that, if I say to continue, on each message arriving): java.io.IOException:
Hi. I found the error. Just a typing mistake, BUT I have another problem, now receiving messages: Using this sub: Code: Private Sub mqtt_MessageArrived (Topic As String, Payload() As Byte) Dim obj As Object = serializator.ConvertBytesToObject(Payload) Dim s As String = obj Label2.Text = s End Sub Just at start up (and after that, if I say to continue, on each message arriving): java.io.IOException:
Erel B4X founder Staff member Licensed User Longtime User Aug 26, 2016 #71 Your code is wrong. However as it is not related to ByteConverter library you should start a new thread in the questions forum.
Your code is wrong. However as it is not related to ByteConverter library you should start a new thread in the questions forum.
wonder Expert Licensed User Longtime User Sep 21, 2017 #72 Hello, Is the source code for this library available anyhow? Many thanks in advance.
agraham Expert Licensed User Longtime User Sep 21, 2017 #73 Here's the Eclipse project Attachments ByteConverter1.1.zip ByteConverter1.1.zip 8.9 KB · Views: 1,007
Z ziomarconeri Member Aug 10, 2020 #75 Hello , I created an app that communicates via tcp with an instrument using also the byteconverter 1.1 library on the android 5 version. The problem is that it doesn't work with android 9 or higher. Can you help me please. thank you Attachments error.jpg 75.4 KB · Views: 759
Hello , I created an app that communicates via tcp with an instrument using also the byteconverter 1.1 library on the android 5 version. The problem is that it doesn't work with android 9 or higher. Can you help me please. thank you
Erel B4X founder Staff member Licensed User Longtime User Aug 11, 2020 #76 Please start a new thread for this question.
Erel B4X founder Staff member Licensed User Longtime User Apr 28, 2021 #77 Library will be included as an internal library in the next versions of B4A and B4J. Similar implementation is available in B4i in iRandomAccessFile library.
Library will be included as an internal library in the next versions of B4A and B4J. Similar implementation is available in B4i in iRandomAccessFile library.
Alessandro71 Well-Known Member Licensed User Longtime User May 2, 2021 #78 You land on this page by clicking on ByteConverter in the Libraries tab, but differently from the other libs, the first post does not contains any useful info about it: no list of Subs, no "How to use" section.
You land on this page by clicking on ByteConverter in the Libraries tab, but differently from the other libs, the first post does not contains any useful info about it: no list of Subs, no "How to use" section.