I wrote an android app and for development, I used a local XAMPP server. On the server side I use a mysql db and a few php files that contain the queries. On the android side, I use HttpURLConnection as shown below
url = new URL(AppHelper.SERVER_URL + phpFile);
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestMethod("POST");
request = new OutputStreamWriter(connection.getOutputStream());
request.write(parameters);
request.flush();
request.close();
String line = "";
InputStreamReader isr = new InputStreamReader(connection.getInputStream());
BufferedReader reader = new BufferedReader(isr);
StringBuilder sb = new StringBuilder();
Now I am at a stage where I would like some friends try out the app, so I want to set up a hosted webserver. Now I am hoping to get suggestions which service to use so that I can salvage and recycle most of my code and files. Please note that I am very unfamiliar with this, so user-friendliness is an important criteria. What are the preferred ways of moving from a local server to a hosted server solution?
You can use any web hosting site, sign up there. and upload your all php files on that server. Create MySQL Database and create all necessary tables on Server.
Use Filezilla for syncing PHP files from server to local or vice-versa.
You can use heroku for hosting your serverside app. You Just only have to follow the tutorials from heroku and you will get your serverside webservice running in minutes and get URL for your server side webservice.
here is documentation for heroku.
You can also use openshift alternatively.
As for me Heroku works well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With