• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps What type of request to send to server, (POST,GET,PUT)

raptorcode

Lurker
Hey so my group designing an Android app which is just a Transit app. We have get requests to our SQL server which is working great. Another feature of our app is to webs-crape live data from a website which gives the estimated amount of arrival time to that stop.
We are successfully we-scraping those times on a Python script and printing them out on the server. We do not how we are going to send those times back to the app. The main problem is that the data must be generated live which takes 2-4 seconds for the Python Script to complete.
We want to:
1. When the user selects a stop, a request will be made to the server, sending the corresponding STOPID of the stop the user has selected.
2. The server will receive the STOPID in a PHP file which the PHP will then call the Python script, and the PHP will read the output from the script and put it into JSON data.
3. The JSON data is then sent back to the app and displayed to the user <--- How do we do this??

I am new to HTTP requests and not sure what to do for this.

The only solution I see is immediately writing the outputted times to a unique text filename generated on the app and sent along with the stopID which the server will write a text file to and then the app will delay ~5 seconds to then attempt to GET the data from the URL+/"uniquefilename"

Our server is Linux based, running Apache.
 
Back
Top Bottom