Sending/Saving gps location

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Sending/Saving gps location

Postby i_raqz » Sun Mar 21, 2010 11:57 pm

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.



Note: I have declared myLocation as public in the main function.
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,
raqz
Code: Select all
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: Select all
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();
Thanks,
raqz
i_raqz
Freshman
Freshman
 
Posts: 8
Joined: Sun Mar 21, 2010 12:26 pm
Location: Pittsburgh

Top

Return to Map Problems

Who is online

Users browsing this forum: Exabot [Bot] and 3 guests