开发者

How to send object from android phone to servelet?

I have a class within my application when instatianted i could to send to a servelet.

public class PinnedVehicle {

    private String userId;
    private Location location;
    private Date timeToReturn;
    private String notes;
    private Bitmap photo;
    }

now for location i only really need the longitudes and latitudes, but how would i go about sending this to my server

at the moment all i do is

 String URL = "xxxx";
 String result = "";
 String deviceId = "xxxxx" ; 
 String q = "?lat="+location.getLatitude()+"&lng="+location.getLongitude()" //and so on for all strings and integers

 HttpClient httpclient = new DefaultHttpClient();  
 HttpGet request = new HttpGet(URL+q);  
 request.addHeader("deviceId", deviceId);  
 ResponseHandler<String> handler = new BasicResponseHandler();  
 try {  
     result = htt开发者_开发知识库pclient.execute(request, handler);  
     } catch (ClientProtocolException e) {  
         e.printStackTrace();  
     } catch (IOException e) {  
         e.printStackTrace();  
 }  
 httpclient.getConnectionManager().shutdown(); 

How would i go about sending the date object and bitmap object?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜