dongzengzai4567 2015-11-02 13:14
浏览 856
已采纳

将Android Studio连接到Web服务到SQL Server

i heard that the best way to connect android to sql server database is by creating web service around it. Is there any specific tutorial to create the web service?

  1. Do we need install server like xampp for mysql or it will be just fine with sql server management studio?
  2. What is exactly a web service? Connecting via post method to php is a web service?
  3. What software i must use to make it work?

    -android studio

    -sql server management studio

    -php written in notepad (?)

    -apache tomcat?

    anything else?

Sorry for bad english, Thanks

  • 写回答

1条回答 默认 最新

  • dqly83915 2015-11-02 13:33
    关注

    You gave us a very broad question.

    I'll try to get you going.

    First, a webservice can be a lot, but most often it is a server (php in your case) that uses SOAP.

    Look up SOAP yourself to get the details, but it boils down to sending XML files to the server. The server then responds with something appropriate.

    Here is a very short introduction with code, just to get the idea what it is about:

    http://www.codeproject.com/Tips/671437/Creating-Web-Service-Using-PHP-Within-Minutes

    The reason you want a wrapper around your database is this: You don't want to allow everybody to access your database directly. So you write a wrapper around it, that ONLY performs tasks you allow it to.

    For example: Get all users in group x. Or: Update the birthday of userid 455. etc. That way you control what goes in and out, and you only have to send some XML to get the job done. Your PHP script will take care of the actual database interaction.

    Where you write your PHP in isn't very important. I would advice you to use at least an editor with syntax highlighting and UTF8 support.

    Don't use Notepad.

    Look up notepad++ if you want something better: Notepad++ can do that. If you take bigger projects you probably want to use a real IDE. (There are many for PHP)

    Apache? Linux? Windows? As long as you can run PHP, it is OK. If you are planning to use MSSQL Server from Microsoft, you will have an easier time if you run on windows. If you use mySQL, it doesn't matter too much.

    I want to warn you: You seem to be pretty new to PHP (since you asked if Notepad is OK to develop in). This project might be a little over your head. :-)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64