i am implementing gps provider getting langitude and longitude from device i am already get the information in device i can implemented network provider that is the problem how can implemented using network provider
views:
170answers:
1
Q:
how to get lattitude and langitude in network location provider in device android java application
+1
A:
The code is basically the same. Obtain a provider (gps, network, etc.), call getLastKnownLocation. Additionally you can request location updates for this provider. But you can't test this using the emulator, you'll need a phone.
LocationManager manager = (LocationManager) Context.getSystemService(Context.LOCATION_SERVICE);
manager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
// additionally (you have to implement LocationListener)
manager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0.0f, new LocationListener() ...)
Nikola Smiljanić
2010-03-02 12:07:34
thank you very much
2010-03-10 03:57:49