Skip to first unread message

Caike Oliveira

unread,
Nov 28, 2017, 1:54:31 PM11/28/17
to MIT App Inventor Forum

Hello, I am new to App Inventor 2 and am in need of some help about Uriencode.

I am developing and app in wchich the user has to take a picture and, afterwards, input some other data (this app is meant to replace an older one). After all data has been input, they are all saved on an Sql Server through a Json web service. This Sql Server, then, connects to another program which retrieves all of the data including the picture.


The old app encodes the picture and saves it as a huge string on the Sql Server which is read on the other program. Now, here is my problem: I simply can't save the picture the same way. I read that I am supposed to use the component Web1.UriEncode, but the string generated is completely different. Also, I can't seem to call for it in any way.

This is a sample of how the string encoded by the older app looks like (the actual string is over 40,000 characters long): /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
...
This is how App Inventor 2 encodes: file%3A%2F%2F%2Fstorage%2Femulated%2F0%2FPictures%2Fapp_inventor_[xxxxxxx].jpg

My questions are: how can I call it?

TimAI2

unread,
Nov 28, 2017, 3:48:26 PM11/28/17
to MIT App Inventor Forum
The old way was using a binary data (possibly with base64) encoding see here

Caike Oliveira

unread,
Nov 29, 2017, 10:17:31 AM11/29/17
to MIT App Inventor Forum
I see... So, is there a way to save an image as a binary data in Mit App Inventor 2?

Taifun

unread,
Nov 29, 2017, 10:29:06 AM11/29/17
to MIT App Inventor Forum
one of these extensions might help
Image Base64 Extension by Sivagiri_Visakan

for a list of available extensions, see also here https://puravidaapps.com/extensions.php

Taifun

Caike Oliveira

unread,
Dec 1, 2017, 12:44:08 PM12/1/17
to MIT App Inventor Forum
Thanks for the help. This second one is being quite usefull.
Reply all
Reply to author
Forward
0 new messages