App freezing after POST call fails

Let me come back to my previous suggestion

to reduce the length of the base64 string to find out, if the app still crashes

Taifun

I reduced the resolution of the image to a very low one. It actually worked. How is this correlated?

What was the size/resolution before and what is it like now?

Which means, the app displays the error message without crashing now?

What was the length of the base64 string before and what it is now?
Now do sone more tests with better resolutions until you find the best solution

Taifun

Yes

I should do some more tests to find out the lenght of the Base64. I just changed the resolution to 500x500(for tests) from a starting one of 4080x3000.

Can you explain me why the app crashes if the resolution is too high? Shouldn't it just display the error even if the image size is high?

4080x3000/Around 5MB before, 500x500(for tests)/300kB after

I did some tests for my application, trying to find a good resolution for my photos which does not cause a crash. The max resolution i found out for now is 1000x1000, taking a larger image will cause a crash.
I found out a new information, that could be important. After the app tries to upload an image without connection, there is a small period of time where the app is completely unresponsive. After that time, the error is written in the chosen label and the application returns to work normally. I think this period of time is the cause of all the problems(?). Android closes the app automatically after too much time is spent in this state? Hope I explained that well, as you can see my english is not good. I'm still online for clarifications if necessary