I am developing an android
app and recording a video and uploading it on server is one feature of it. I have been researching alot how to upload the recorded video on server but all the answers on SO and all the articles that I have read are using MultipartEntity
. Now, what I have been wondering is that MultipartEntity is deprecated quite a while ago and I couldn't find any other way to upload a video on server so is there any library
or something that android has introduced for uploading the video on server after deprecating MultipartEntity? If yes, please send me a link. Secondly, if I still use MultipartEntity in my android app, will it cause any problems/bugs in the future?
Asked
Active
Viewed 369 times
0

M Salman
- 170
- 1
- 11
-
"MultipartEntity is deprecated quite a while ago" -- there is no `MultipartEntity` in the Android SDK. This might be from Apache HttpClient, which was removed from the Android SDK a few years ago. OkHttp is a popular alternative: https://square.github.io/okhttp/recipes/#posting-a-multipart-request-kt-java – CommonsWare Apr 19 '21 at 12:17
-
@CommonsWare I am using Intent to launch the camera and then in my onActivityResult() method, the intent returns me uri of the video file so can we use OkHttp to send this video file to server? – M Salman Apr 19 '21 at 15:00
-
There are a few implementations of `InputStreamRequestBody` that you can use for this -- see https://stackoverflow.com/questions/56308559/create-a-file-from-a-photo-uri-on-android – CommonsWare Apr 19 '21 at 15:11
1 Answers
0
recorded video is also a file, sou you can use for example retrofit 2 to upload a file to server

Александр Волошиновский
- 1,123
- 8
- 21