简体   繁体   English

Android社交网络应用程序的Web服务?

[英]Web service for android social networking app?

I am developing social networking app on android.Rough idea of my app is that when user launches an app it will get all users of this app in near by location.So for storage purpose of users data I want to use web server. 我在android上开发社交网络应用程序。我的应用程序的想法是,当用户启动应用程序时,它将使该应用程序的所有用户在附近的位置。因为用户数据的存储目的,我想使用Web服务器。 I don't have an idea what is best way to start with.Should i use Amazon web services ? 我不知道什么是最好的开始方式。我应该使用亚马逊网络服务吗? (S3,Ec2) I was surfing internet got these buzz words. (S3,Ec2)我在网上冲浪得到了这些流行语。 Please guide me what is best approach for database storage ? 请指导我什么是数据库存储的最佳方法? Should i write my own server api ? 我应该编写自己的服务器API吗? or What ? 要不然是啥 ?

I personally favor using a MySQL database with PHP to interface between the app and the backend! 我个人赞成使用带有PHP的MySQL数据库来连接应用程序和后端之间的接口! Your app can send requests to PHP and then your PHP webservice would write/read to the database and then return JSON to your app. 您的应用程序可以向PHP发送请求,然后您的PHP Web服务将写入/读取到数据库,然后将JSON返回到您的应用程序。

I would say this is a very subjective question though as there as so many ways that you can write a web service. 我会说这是一个非常主观的问题,因为有很多方法可以编写Web服务。

These are some general things you will have to do: 这些是您将要做的一些一般事情:

  1. Buy some server space where you can host your server (this is the amazon ec2, etc). 购买一些可以托管服务器的服务器空间(这是亚马逊ec2等)。 If you need a fancy domain name, buy that too, and map it to IP address of the server that you brought (optional). 如果您需要一个精美的域名,也可以购买,并将其映射到您带来的服务器的IP地址(可选)。
  2. Setup a db of some kind on this server to store your data (msql) 在此服务器上设置某种类型的数据库来存储您的数据(msql)
  3. Write wrapper web services (php, jsp, etc) which will expose apis to access your data remotely. 编写包装器Web服务(php,jsp等),它将公开apis以远程访问您的数据。 For security reasons, you should also have some authentication using some token passing mechanism. 出于安全原因,您还应该使用一些令牌传递机制进行一些身份验证。
  4. Access the data on your server remotely using the APIs you created in the web service. 使用您在Web服务中创建的API远程访问服务器上的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM