0

I am trying to write an Android app to connect to an existing web service. I'm pretty new to web services in general, other than what I've done with this first web services (written with JSPs, Struts 1.x, and JAVA).

This web service is connected to a document storage database. The user would first login to the service, then using search parameters (document title, type, etc.) the user would be displayed a list of possibly relevant documents. The user would choose a specific document from that list, and the service would then stream the entire document (pdf file) to the user for viewing.

What methods are available to Android where I can make a request given some specific parameters, and be able to parse a response?

The only thing I know of is HTTP, but my project leader (I'm a summer intern) is hinting that there are others available. I'm not sure where to start looking.

Thank you.

komidore64
  • 55
  • 1
  • 1
  • 8

4 Answers4

0

Is it a web service or a web application? If it's a bona fide web service, it should support SOAP or REST, for which there are Java libraries, but none included in Android so far. If it's a web application (just a html based user interface), you're going to have to look at web scraping of some sort -- I hope not, for your sake and for future maintainability. Perhaps you should ask your project leader to be a bit more forthcoming!

Community
  • 1
  • 1
Pontus Gagge
  • 16,731
  • 1
  • 36
  • 50
  • The document viewing API has an encompassing SOAP service class that can be called to execute the request to the database. Currently it does have web-pages that are used for the UI. the UI forwards parameters to JAVA-code that communicates with the document database via SOAP. I want the Android app to communicate directly with the document database. – komidore64 Jul 21 '10 at 15:32
0

You could also find that sending binary messages over socket connections is another option - more opaque and less bytes used. See Google Protocol Buffers for an example.

Rich
  • 15,093
  • 14
  • 75
  • 122
0

You should ask for an api document or specification for whatever it is you're going to connect to from the Android app.

For extra credit (I always like to see initiative from Engineering Interns), you may want to volunteer to write the document or to further edit it as necessary.

It is often the case that api docs are out of date or were never really used. (Especially if the same person or team wrote the existing server and client(s).)

Larry K
  • 42,977
  • 12
  • 82
  • 121
0

I went with using the HttpClient class. It is working except now I'm struggling with getting my HTTP GET messages short enough. Base64 compression isn't doing quite enough. Thank y'all for your helpful answers.

komidore64
  • 55
  • 1
  • 1
  • 8