Hi I understand the documentation about activity and service lifecycle. 
Generally speaking, what's the approach if you want to have an application 
which gets unlimited proximity alerts, basically a service that doesn't die? 
I've tried startService with requestLocationUpdate etc. but after a while the 
service seems to get killed by the OS. That's basically question 1) :-) 

Now to problem 2) I've tried to do addProximityAlert but it doesn't really seem 
to work. I am basically doing something like

Intent updateIntent = new Intent(this, LocManIntentReceiver.class);
updateIntent.addCategory(Intent.CATEGORY_INFO);
updateIntent.setAction(Intent.ACTION_LOCALE_CHANGED);
// Put the information into the Intent


updateIntent.putExtra[..]
// Create a pending broadcast intent for the proximity alertPendingIntent 
pendingIntent = PendingIntent.getBroadcast(this, -1, updateIntent, 
PendingIntent.FLAG_UPDATE_CURRENT);
// Add a new proximity alert, update the old one
locationManager.addProximityAlert((double)latitude/1E6, (double)longitude/1E6, 
(float)1, 1000000, pendingIntent);

But if I set a breakpoint or do a Toast.makeText in the onReceive function of 
the BroadcastReceiver, I never get anything.

Now to problem 3) :-) I've tried to set up a mock location provider by starting 
a "Timer" which periodically spits out a new location, and I set up a 
LocationListener. The timer does something like this

LocationManager locationManager = 
(LocationManager)mContext.getSystemService(Context.LOCATION_SERVICE);
locationManager.setTestProviderLocation(LocManager.MOCK_LOCMAN_PROVIDER, 
fakedLocation);

I am passing the context in the constructor of the Timer object when 
instantiating it. The location listener in the main activity never received an 
update but the very first one. Any take on that?

- 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