Hi,

I am currently working with a HTC G1 and I am trying to retrieve my
GPS position. But I can not understand very well the documentation. I
wrote those lines, but they didn't work.

        LocationManager mgr = (LocationManager) this.getSystemService
(Context.LOCATION_SERVICE);
        GPSSensor gps = new GPSSensor(mgr);
        String provider = "";
        provider = mgr.getBestProvider(new Criteria(), true);
        try {
                Location loc = mgr.getLastKnownLocation(provider);
                tv.append("**** Location: " + loc.toString() + " ****
\n");
        }
        catch(Exception e) {
                tv.append("provider == null");
        }


[tv is a TextView object]
It already write "provider == null" so I guess that
"mgr.getBestProvider(new Criteria(), true);" returns null.

Could you explain to me what I need to do?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to