Hi everyone,
I found a way to convert text to binary in MIT App Inventor, but I’m struggling to do the reverse: converting binary back to text.
Here’s the code I’m using to convert text to binary:
xd.aia (8.9 KB)
Now, I need to decode a binary sequence back into readable text. Is there a way to achieve this in MIT App Inventor using built-in blocks or an extension? Any help or guidance would be greatly appreciated!
Thanks in advance!
ref here..
I made a sample program showing how to encode a character to UTF8 and how to decode it. The program will use the Web component and the asynchronous extension hence .
UTF8.aia (24.4 KB)
[blocks (48)]
incomplete blocks you have provided in the aia
TIMAI2
March 4, 2025, 4:23pm
3
Some more javascript ideas here (includes solutions for text to binary as well):
My fault, I've uploaded an old version of the program, this should be working
emitter.aia (9.3 KB)
Thanks for the linke, I've tried with it also but doesn't work for me. It converts chart by chart, i need all the text converted at the same time, just the way it converts text2bin in the program i've sent
Thx for the info, i've been reading it and i find it a little complicated to implement in a MIT coding
ABG
March 4, 2025, 6:01pm
7
can't open groups. google, could you show me in another way?thks
THKS, maybe using a list and a loop with bin2Ascii method could help
ABG
March 4, 2025, 6:50pm
10
Here's the code from that post, with draggable blocks too.
AsciiCHRASCprocedures.aia (4.4 KB)
(Some of the png files could not upload to this board. You can find them in the aia.)
Hello there again, thx for all the information provided. I need something more related to what I provided. The steps I should follow would be.
I have a string in binary. Eg: 10010101
Converting this string into ASCII code
Converting this ASCII into text form
Challenges:
• all this binary msgs have it's header (you can apply wtever you want)
• every ASCII code must get 8bits/frame
Eg complete program:
11111111 11001100 11100011 11011100 110101010
Header: 11111111
11001100 -> 68(ASCII) -> H
11100011 -> 45(ASCII) -> O
11011100 -> 77(ASCII) -> L
110101010 -> 86(ASCII) -> A
Show msg: hola
ABG
March 12, 2025, 7:58pm
12
How did you come up with this?
TIMAI2
March 12, 2025, 8:16pm
13
You could use an ascii table for conversion...
asciiTable.csv (1.6 KB)
(convert this to an AI2 list in your app)
It's an example, I've made up the numbers to illustrate how I was trying to do it
Btw, someone knows an AI useful in block-coding? ChatGPT is not working well ok that
ABG
March 12, 2025, 9:09pm
16
How do you know how long the header is?
Is it always just 8 bits?
ABG
March 12, 2025, 9:43pm
17
The non-extended ASCII table only covers 7 bits.
To dump a file you would need to learn Javascript, as in
TIMAI2
March 13, 2025, 1:59pm
20
Like so ?
binaryToText.aia (3.1 KB)
(the binchar.csv contains only upper and lower case alphabet and number 0-9)
Note it may be better to use for each number from
to avoid issues with repeat binary values.
Just like that yes :). Although I need it to decode every text. But that's the idea!!!
TIMAI2
March 13, 2025, 2:54pm
22
If you need other characters, add them to the binchar.csv file. The list from csv table block did not like some of the characters.