locationmanager

Unsubscribing a LocationListener from the LocationManager

How do I unsubscribe a LocationListener from recieving updates from the LocationManager? Here is how I'm setting it up mLocationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE); mListener = new LocationListener() { public void onLocationChanged(Location location) { Log.i("LocationListener", "Logging Change...

Why does my LocationListener become null?

I am having issues regarding a LocationListener in my Service called myService. Here is my code: ///onStart method .. onStart() { locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE) . . provider = locationManager.getBestProvider(criteria, true); locationListener = (LocationListener) new M...

LocationManager in 2.1 not working?

Hello, I have been trying to get the following code to work for the last 4 hours. public void clearLocation() { LocationManager locMan = (LocationManager)getSystemService(Context.LOCATION_SERVICE); locMan.clearTestProviderLocation("gps"); My problem is that it will only work with Android 1.5. On 1.6 and newer it...

Recreate "gps" LocationProvider after removal?

Hi. I'm currently having some problem with my application. I accidentally ran the following code: locationManager.removeTestProvider("gps"); And now i obviously can't get a GPS fix in google maps.. have to reboot. But my app need to remove the original GPS provider to create it's own fake one. So im just wondering if it's possible t...

why does this work on android 1.5 but not 1.6 (location manager)

I have this bit of code; lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); gpslocation = Double.toString(lm.getLastKnownLocation("gps").getLatitude()) +" " + Double.toString(lm.getLastKnownLocation("gps").getLongitude()); Which works fine on both the emulator and my hero running android 1.5, but it Force Closes...

"Don't Allow" in LocationManager keeps logging errors

I have an app that checked for location. It asks the user to use location and if the user says no on the menu there is an issue when i load the mapview. Once i select the mapView it asks for the user location again. If the user says no again my console keeps displaying errors/warning as well as my NSLog from the "didFailWithError" of my...

How to get the current location of iPhone through code?

How do you get the current location of iPhone through code? I need to track the location using GPS. ...

Specify intervals for Location Manager to broadcast current location in Android

Hi, Is there any way to specify the time intervals that the Location Manager broadcasts the current location? I am using a method called startListening: public void startListening() { locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, t...

locationManager:didUpdateToLocation:fromLocation: vs. mapView.userLocation.location

For the moment, I use mapView.showsUserLocation=YES; for the radiating blue icon showing the iPhone's position, but do not know how to get the coordinates behind it. I tried the locationManager:didUpdateToLocation:fromLocation: with the configuration of self.locationManager = [[[CLLocationManager alloc] init] autorelease]; locationMana...

Android Location Error

I've singled out my problem to a few lines of code lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000L, 5.0f, this); lat = location.getLatitude(); lng = location.getLongitude(); //lat = n...

How does getAltitude() of Android GPS Location Works

HI I tried to implement a simple GPS tracker. Therefore is used lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE); lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 0, this); Then i used the public void onLocationChanged(Location location) { method to read the altitude of my current location. But i ...

Setting acquired location to a text view: How to maintain?

Hi, I have built an app for the Motorola Droid which should automatically update a server with the phone's location. After the user performs a particular task on the main activity screen, an alarm is set to update the user's location periodically, using a service. The alarm is explicitly stopped when the user completes another task. Th...

Getting Base Station Information in Android

Hello Everyone! Is there anyway to get the base station and/or cellId information of the subscriber in Android? ...

Android: GPS location updates when the cellphone is in sleep?

I need to update the location through GPS in the background even when the phone is in sleep. I am thinking to use AlarmManager to broadcast an Intent and then a receiver will call requestLocationUpdates() on LocationManager. But I am not sure whether it's guaranteed that the GPS location will be updated when the phone is in sleep and an ...

Android LocationManager and it's updates

Can someone tell me, what is the best way to deal with situations when there is no GPS signal or from some reason fix cannot be acquired? The thing is that I thought that it would be sufficient just to use onStatusChanged method from LocationListener, but when there is no GPS signal it never calls this method. Why is that? Thanks ...

iPhone locationServices: accuracy displayed incorrectly!?

Hi, everyone i've been trying to figure this out and i have absolutely no clue why this happens. Here is what i'm trying to do: I am building a little gps application and i want things like coordinates, altitude, speed, etc. displayed on my main view. I also want to show the current horizontal accuracy. I do this by using the "locatio...

iphone core location: distance filter how does it work!?

Hi, Just ashort question. what exactly does the "locationmanager.distancefilter" property? does it dermine how often the "didUpdateTolocation" method gets called?? ...

IPhone Get HTTP Response or Bad_Access after reload my View with Geocoding

Hi all, i have a class for my geocoding (locationManager and reverseGeocoder). After the first load i see my location in my lable without any problems. after leave the view and load the view again i see in my lable http response-codes ("User_Agent" Accepted....) or get a bad_access and my app freeze. here is my code for this class: #i...

GPS lookup and user preference

Hi, I'm starting to dip my toes into LocationManager. I've created a service which tracks GPS location (interval is more than 60000ms) and updates my application with user location so they can find stuff nearby. As I understand it, users can go into their preferences and disable GPS for a particular application. I would essentially l...

Android: Nothing past onCreate is happening.

Hi guys, I got this class, and nothing inside the onCreate is happening? Does it not automatically get called upon initialization? Code is below, Thanks alot! - Micheal package com.michealbach.livedrops; import java.io.IOException; import java.util.List; import java.util.Locale; import android.app.Activity; public class AnyClass ...