Hi,
 
I am trying to read data from an android app and want to display on the 
web. 
As per my understanding, I need to expose through REST Webservices which 
can be consumed in Web Application.
 
Sample Code I am trying:
 
//Class representing an XML. Using SimpleXML framework jar.
 
import org.simpleframework.xml.Path;
import org.simpleframework.xml.Root;
@Root
public class Car {
 @Path("fuelAssist")
 private String fuelLeft;
 public String getFuelLeft() {
  return fuelLeft;
 }
 public void setFuelLeft(String fuelLeft) {
  this.fuelLeft = fuelLeft;
 }
 
}
 
//REST WebService which is populating the xml
 
@Path("/androidWebService")
public class AndroidWebService {
  
 @GET
 @Path("/carDetail")
 @Produces("application/xml")
 public Car getCarDetails() {
  Car car=new Car();
  car.setFuelLeft("10%");
  return car;
 }
}
I didn't find any example for the same. Please let me know, if I am doing 
it correctly.
Also let me how to consume this webservice from a WebApplication. Any 
example will be helpful.
 
Thanks in advance!
 
Regards,
Ashish
 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to