All I am trying to do is a real simple app that gets the location that I send it via eclipse and displays it. Location keeps returning null after lines below.
LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
Any help would be appreciated. As of right now, i don’t care about updating locations yet.
This is my first app, be gentle.
Thanks
Generally this means that the GPS hasn’t found a fix yet, since you’re asking for a location immediately (It’s actually returning null BEFORE you’re sending co-ordinates through).
You need to make a Location Listener, which will listen for changes in the state of your GPS.
Here’s an example.