0

I'm developing my first android application, I'm trying to send video files I've recorded and saved in the applications External Cache Directory as well as other data like usernames, etc. I have a play application running on my server and have a mySQL DB running on my server.

I have experience with JDBC and oracle, but am unsure of how I should make the connection between the android app and the play app, I'm thinking I don't want the android app talking to the mySQL DB ever! that I'll send a JSON object from my android application to my play application, the play application will then take the JSON object parse it and update the DB with the user details and a pointer to the video file and also add the video file to the designated folder.

I'm unsure how to implement the connection on the the android app, do I create a new activity or maybe a fragment for the connection to the play app? a link to a simple tutorial taking a video file and sending it as a JSON object to a play application would really get me going. I realize that might be a bit much to ask.

I was reading this post MultiPartEntity and thought it might be along the lines of how I would make the connection from the android app to the play app, but was unsure if it was using JSON(the comments suggest it does, but I can't see any JSON object creation) is MultiPartEntity a good solution for my connection needs?

How do I deal with the JSON object when I receive it on the server end? I'm thinking I'll have a route set up to deal with, but again a link to a similar example would be great.

Any help pointing me in the right direction is appreciated.

Community
  • 1
  • 1
JTK
  • 1,359
  • 2
  • 18
  • 37

1 Answers1

1

Your Play! application must have an endpoint to send data with post method (RestFul Web Service), Play! is Restful, just handle the uploaded file in your Action. In your Android Application, you can send data with Volley Library follow this link to do that How to multipart data using Android Volley or your follow this tutorial with php web service but with what you want http://www.androidhive.info/2014/12/android-uploading-camera-image-video-to-server-with-progress-bar/

Community
  • 1
  • 1
Angbeny Finch
  • 179
  • 1
  • 1
  • 8