How to convert binary data to text and text to binary data

A string of data from an external device downloaded to the application via bluetooth. The device sends a long configuration string to the application. There are both text and numeric values in this string. AppInventor only distinguishes between text and numerical data in the bluetooth component. Read / send text and read / send byte. But the device sends it all together. The decoding of everything to a readable form only takes place on the application side. The decoded information is saved in the dictionary as a key and value. The values are stored in hexadecimal form. For example, the word AppInventor is 417070496E76656E746F72. This way, the configuration is also saved to the file as a backup and sent back to the device. Someone once needed such conversion Ascii <=> Number and someone solved it by adding the string ascii to the text variable and wanting to convert ascii to a number, the positions of this character were taken. It is similar here except that not ascii but utf8.

The third and final method is extension :smiley: :

3 Likes