0

I would like to have some advice on how to save images on the server and the URL address in the MySQL table through an android app.

I have seen many tutorials on the internet but nobody satisfies me, it takes a long time to upload an image, like ten seconds.

In most tutorials you take a Bitmap and convert it to Base64.

What I would know, is if there are any best practices for uploading images to the server with URLs with an android app.

That is, whether to use Multipart or Base64.

Or advice on how to make image loading fast or something like resizing large images so you can load them faster.

I'd love to hear your opinion.

Thank you

piet.t
  • 11,718
  • 21
  • 43
  • 52
Marie Hopkin
  • 61
  • 1
  • 7

1 Answers1

1

Approach will totally depend upon requirement.

In order to make things faster at some point you will have to add some restrictions. You will have to think as to what maximum size you will need on server, like 1024, 2048 etc. then you can resize the images being uploaded from client end.

While fetching you can either use some image library at server end to bring resized images at places like thumbnails, or can cache them at user end.

To upload you can either use Multipart or send raw bytes separately in one api , then return server image name and send that in other api which saves rest of the data.

I am not sure of standards but I resize at client end, send Multipart to server or sometimes raw also (depending upon what framework I am using at backend) and fetch un resized images from server and cache them.

Hope this provides some help.

Thanks

viv
  • 6,158
  • 6
  • 39
  • 54