gpt4 book ai didi

android - 为 Android 应用程序创建 Web 服务

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:40:37 24 4
gpt4 key购买 nike

我一直在阅读有关使用 SOAPREST 的 Android Web Services 的一些信息,但我从未创建过 Web 服务,所以我对此有很多疑问。

我正在开发一个 Android 应用程序,用户可以在其中回答一些问题,然后为每个用户生成一个 XML 文件并将其保存在设备中。

这是我的查询:

  1. What I would like to do is to send these XML files from the devices to the Web Service and also sometimes to retrieve all the files to any device.

  2. Do I need to convert these files into Byte or just send the XML?

  3. Are these actions possible with the Web Service or will you use Java Sockets? In case you prefer the Web Service, what would you use: REST, SOAP.

我希望能提供一些教程链接和建议。

最佳答案

使用 SQL Server 管理桌面上的数据,并在 Visual Studio 的 .NET 中创建 Web 服务。

然后连接到您应用程序中的网络服务,并使用网络服务从数据库中设置/获取数据。您可以使用 XMLJSON 在手机和服务器之间传输数据。

不需要为此使用 Java Socket API。

可能有用的链接:

如何在 .NET 中创建 Web 服务(不包括在 Android 中的实现): http://srikanthtechnologies.com/blog/dotnet/wsdaljava.aspx

如何将您的服务与 Android 连接:

http://seesharpgears.blogspot.in/2010/11/basic-ksoap-android-tutorial.html

http://www.codeproject.com/Articles/304302/Calling-Asp-Net-Webservice-ASMX-From-an-Android-Ap

http://adrianandroid.blogspot.in/2012/05/access-c-net-web-service-in.html

注意:我从未从事过 RESTful 服务。我的工作一直是关于 SOAP 的,因此它仍然是我的偏好。

关于android - 为 Android 应用程序创建 Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15600906/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com