创建Web服务的Andr​​oid应用程序 [英] Creating Web Service for Android Application

查看:117
本文介绍了创建Web服务的Andr​​oid应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读有关Web服务为Android的一些信息使用SOAP和REST但我从来没有创建了一个Web服务,所以我对这个许多问题。

I've been reading some info about Web Services for Android using SOAP or REST but I've never created a web service so I have many questions about this.

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

I'm developing an Android App where the users answer some questions and for each user an XML file is generated and saved in the device.

下面是我的查询:

  1. 我想要做的是从设备,这些XML文件发送到Web服务,也有时检索的所有文件到任何设备。

  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.

我是否需要将这些文件转换成字节或者只发送XML?

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

这些行动可能与Web服务,或将您使用Java套接字?如果你$ PFER Web服务p $,你会用什么:REST,SOAP

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.

我会AP preciate一些教程的链接和一张告知。

I would appreciate some links to tutorials and piece of advise.

推荐答案

使用SQL Server来管理数据您的桌面上创建一个Web服务在.NET上的Visual Studio。

Use SQL Server to manage the data on your desktop and create a web-service in .NET on Visual Studio.

然后连接到 web服务在应用程序和设置/从DB获得数据,使用网络服务。您可以使用 XML JSON 以手机和服务器之间传输数据。

Then connect to the web-service in your application and set/get data from the DB, using web-services. You can use either XML or JSON to transfer your data between the phone and the server.

没有必要使用Java的Socket API此

There is no need for the use of Java Socket API for this.

链接,这可能是有用的:

如何使Web服务在.NET中(不包括在Android上实现): <一个href="http://srikanthtechnologies.com/blog/dotnet/wsdaljava.aspx">http://srikanthtechnologies.com/blog/dotnet/wsdaljava.aspx

如何与And​​roid连接您的服务:

<一个href="http://seesharpgears.blogspot.in/2010/11/basic-ksoap-android-tutorial.html">http://seesharpgears.blogspot.in/2010/11/basic-ksoap-android-tutorial.html

<一个href="http://www.$c$cproject.com/Articles/304302/Calling-Asp-Net-Webservice-ASMX-From-an-Android-Ap">http://www.$c$cproject.com/Articles/304302/Calling-Asp-Net-Webservice-ASMX-From-an-Android-Ap

<一个href="http://adrianandroid.blogspot.in/2012/05/access-c-net-web-service-in.html">http://adrianandroid.blogspot.in/2012/05/access-c-net-web-service-in.html

注意:我从来没有在RESTful服务。我的工作一直在SOAP,因此它仍然是我的preference。

Note: I have never worked on RESTful services. My work has always been on SOAP and hence it remains my preference.

这篇关于创建Web服务的Andr​​oid应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆