Katherine99
Katherine99

Reputation: 990

Creating Web Service for Android Application

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.

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.

Here are my queries:

  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.

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

Upvotes: 12

Views: 44549

Answers (2)

Swayam
Swayam

Reputation: 16354

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

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.

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

Links which might be useful :

How to make a web-service in .NET (does not include the implementation in Android) : http://srikanthtechnologies.com/blog/dotnet/wsdaljava.aspx

How to connect your service with 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

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

Upvotes: 12

G. Blake Meike
G. Blake Meike

Reputation: 6715

Your final choice of how, exactly, to architect your app, is going to be based on all sorts of things that you haven't included in your questions: your experience, the experience of the other developers in the project, so on and so on.

I will say this, however. REST is deep in the heart of Android. If you decide to go with REST and, possibly, JSON instead of XML (there is, almost certainly, no reason to use byte arrays), you will find that Android's architecture supports you. SOAP and such and you are on your own.

Upvotes: 3

Related Questions