I could write the location on to a file. Now I tried sending the location information through a socket but the app crashed. Could you please tell me if that's possible.
Thanks, Raqeeb On Mar 21, 6:05 am, raqz <abdulraqee...@gmail.com> wrote: > Hi, > > I have setup the code for fetching the gps location of the device when > the device's location changes. But I want to save this location on a > file or send this location information to my webserver. > I tried creating a class with setter and getter methods but its not > storing the info. When I run the app, it closes with unxpected error. > > Could some one please tell me how to go about this. > > Thanks, > raqz > > Note: I have declared myLocation as public in the main function. > [CODE] > public class MyLocation{ > private double latitude; > private double longitude; > private long time; > > public MyLocation(double latitude, double longitude, long > time) { > this.latitude = latitude; > this.longitude = longitude; > this.time = time; > } > > public double giveMyLatitude(){ > return (latitude); > } > public double giveMyLongitude(){ > return (longitude); > } > public double giveMyTime(){ > return (time); > } > [/CODE] > > [CODE] > public void onLocationChanged(Location arg0) { > Toast.LENGTH_SHORT).show(); > myLocation = new > MyLocation(arg0.getLatitude(),arg0.getLongitude(),arg0.getTime()); > GeoPoint p = new GeoPoint((int) > (arg0.getLatitude()*1E6),(int) > (arg0.getLongitude()*1E6)); > mc.animateTo(p); > mc.setZoom(16); > mapView.invalidate(); > [/CODE] -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.