1

iam about to call a service from my server. Should I use Json or Soap?

My service is in asp.net

Are there not any packages in android that has to do with the service connections?

Troj
  • 11,781
  • 12
  • 40
  • 49

4 Answers4

1

IMHO, a REST interface encoded in JSON will be easier in Android, since there are enough classes built in to handle that. SOAP requires a third-party JAR (e.g., kSOAP2).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks a lot, Iam going to send pictures, and a large texts. is jason sufficient? What kind of service should create in .net, a asmx-file or WCF REST? – Troj Jun 26 '10 at 12:25
  • By the way do you have any samples of the json? (Iam new to this) – Troj Jun 26 '10 at 12:26
  • @Troj: I wouldn't touch .NET with a 10-meter pole, so I have no recommendations there. JSON does not handle pictures; AFAIK, neither does SOAP. I recommend a RESTful service, where you `HTTP PUT` the images and other resources. There are a variety of books on how to create such Web services (e.g., _RESTful Web Services_). – CommonsWare Jun 26 '10 at 12:29
  • CommonsWare why exactly wouldn't you touch .NET? – tobsen Jun 26 '10 at 12:51
  • @tobson: Just personal preference. I gave up on MS server-side a decade ago and haven't exactly missed it. It also runs really lousy on my Linux servers. :-) More seriously, I'm just saying I have no advice on .NET implementations of Web services. I apologize for any confusion my glib comment may have caused. – CommonsWare Jun 26 '10 at 12:58
  • I disagree, MVC is pretty awesome. I developed a web service in C# for my Android project and they work very well together. Note that C# and Java are quite similar so it's easy to work on one project or the other without much of a brain switch. The only disadvantage to .Net is that hosting it is more expensive than the Linux alternative. Also, web deployment from Visual Studio is exceedinly convenient. – Someone Somewhere Apr 05 '11 at 21:58
0

On how to use JSON in Android Sending and Parsing JSON Objects

You could use Http Client and MultiPart Entities for sending images and large text files. Sending images using Http Post

Community
  • 1
  • 1
Primal Pappachan
  • 25,857
  • 22
  • 67
  • 84
0

Json will also be more efficient than soap as well. Check out the Google Io videos from2009. There is a great talk about optimizing apps on android and it specifically deals worth this topic...

Ben
  • 16,124
  • 22
  • 77
  • 122
0

JSON is always easier...it's much easier to parse and doesn't need a DTD..

kenyee
  • 2,309
  • 1
  • 24
  • 32