gps using Network provider and gps provider? - android

Hi, I am trying to get the gps location using location provider and gps provider at the Same time. I am trying for last two days but stil am struggling. I don't know how to do this,I am searching and get this link http://www.hrupin.com/2011/04/android-gps-using-how-to-get-current-location-example, but it's also getting force close. Anybody kindly give working example for gps usind network provider and gps provider

The link you provided is good only. So many examples available in web, one of them is given below.
Using GPS to get current location – Android tutorial
I hope it may help you.

Related

GPS works better with google maps than my App android

I have an app in android using GoogleMaps API.
When i use google maps, I active gps and it find me so fast.
When i use my app, it takes some seconds, and if I'm in my house, gps dont find me. WHY ?
A short summary of my code:
locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
MyLocationListener = new MyLocationListener();
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
7000,
5,
MyLocationListener
);
Thx for answers and sorry for my poor english
EDIT
Thx for answers ! the problem is that i dont want to use network provider. Wifi is exelent, and 3g have a 400 meters error jejeej.
I only want to know, why google maps, using GPS, find me in 1 second with perfect position Although I stay in a house.
Your answer is "use coarse locate". If google maps use network providers befor gps, its impossible he find me so fast. :(
GPS is using satelites, When you are indoor it can't get the signal from the satelites hence it can't find location (can't get a fix).
The GPS needs signals from at least 4 satelites to get a proper fix, that usually takes a few seconds, once you already have a fix you can maintaine it very easly. therfore if you are using google maps it will get you a fix faster.
To get a better understand on how GPS works, check this link
You might want to use different location approachs for getting location indoor (coarse location could be the answer). I would also consider using the fused location by Google play services, it gives you a wrap up on the location providers and get you location based on what avilable at the time (meaning GPS, coarse - wifi or network).
You should try using Coarse locates for a quick locate followed by a fine locate to have a more accurate location. The coarse locate is usually very fast, while the fine one takes more time.
Basically, the idea is to do multiple locates and overriding the less accurate ones by the newer and more accurate locates.
You can find more info on the Android dev doc: http://developer.android.com/guide/topics/location/strategies.html
EDIT: if Google Maps is able to find you so fast, it is because you are not moving and they use the knowledge of the last location. Please read the above link that gives a lot of useful information for Location strategies (and it works very well).

Select provider for location data in android

I am using GPS_PROVIDER to get location information ,but it does not work perfectly in some places. Is there any problem when use Gps_Provider. As I know Network_Provider does not give perfect location information. Please help

in android is it possible to find latitude and longitude using wifi?

In my Application i need to use user's current location.
Through GPS, i knw how to do it but can any body have idea that how it can be done using Wifi?
Pls do my help,
thanks.
Have a look at the Android Obtaining User Location documentation - especially the usage of the NETWORK_PROVIDER.

How to get latitude and longitude values from Cell Id in android?

I am developing a android application in that i want find the user location using GPS. That is working fine .But if the GPS is Disabled means i want to find the user location based on the CellID and Loc .It is possible or not
It is possible means please tell me how to do that with sample code
Waiting for reply
Just request the "best" location provider, and you'll either get the GPS if it's available or the network (wifi / cell) if it's not.
LocationManager.getBestProvider()
You don't need to explicitly code to either GPS / network providers.
Here is complete tutorial of Location-Based Services Using CellID in Android.

Find the current location of mobile without using the GPS

I am developing an restaurant locator for that i need to find the current location of mobile without using the GPS, is it possible?
kindly help me with the codes
Yes you can use the NETWORK_PROVIDER but why would one do that?
http://developer.android.com/reference/android/location/LocationManager.html#NETWORK_PROVIDER

Categories

Resources