从本地xampp服务器移至在线服务器

编程入门 行业动态 更新时间:2024-10-26 06:30:31
本文介绍了从本地xampp服务器移至在线服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我编写了一个android应用程序,为了进行开发,我使用了本地XAMPP服务器。在服务器端,我使用mysql db和一些包含查询的php文件。在android方面,我使用HttpURLConnection,如下所示。

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(参数); request.flush(); request.close(); 字符串行=; InputStreamReader isr = new InputStreamReader(connection.getInputStream()); BufferedReader reader = new BufferedReader(isr); StringBuilder sb = new StringBuilder();

现在我正处于一个阶段,我希望一些朋友试用该应用程序,所以我想设置托管的网络服务器。现在,我希望获得使用哪种服务的建议,以便我可以挽救和回收大多数代码和文件。请注意,我对此非常陌生,因此用户友好性是重要的标准。从本地服务器迁移到托管服务器解决方案的首选方式是什么?

解决方案

您可以使用 heroku 用于托管服务器端应用程序。您只需遵循来自heroku的教程,您就可以在几分钟内运行服务器端网络服务,并获取服务器端网络服务的URL。

此处是heroku的文档。

您也可以使用 openshift 。

对于我来说Heroku效果很好。 / p>

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 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.

更多推荐

从本地xampp服务器移至在线服务器

本文发布于:2023-11-23 10:35:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1621127.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:在线   服务器   移至   xampp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!