M
M
MakarMS2021-01-27 22:08:36
Java
MakarMS, 2021-01-27 22:08:36

How to send image to server via mobile application in Java?

Hello. I was given the source code for an Android application for revision. The application serves as a notepad for images and comments to them. The task is this, to implement sending an image and a comment to the picture to the server after the user saves the note. How can this be implemented? Write api and accept pictures and text or what? Please tell us in more detail.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-01-27
@MakarMS

Good afternoon!
It is not entirely clear whether you are writing the client part or the server part, since both sides are covered in your question.
In short, you need a server side (API). For example, some controller that accepts an array of bytes of a file, as well as other data. Further, the pictures are saved on the server or transferred via API to a distributed file system (for example, S3). And in response to the client part, it returns the url, by which you can download the picture or display it in android.
For the server, you can also raise a small application on Spring Boot. In this case, pay attention to: Spring Data, Spring Web. You will accept MultiPartFile + dto (the note itself). Well, most likely it will be necessary to implement CRUD for pictures and notes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question