What's the trick to making ProximityAlerts work?

by Faber Fedor » Sun, 08 Mar 2009 08:46:51 GMT


Sponsored Links
 ProximityRadius *is* big.  I think I was using 1500 meters in the field test
today.  The "10 feet" I mentioned below was the minimum distance to travel
before doing an location update. And I mean "10 meters".

I beginning to think my mental model is all wrong.  I thought I could
blindly throw intents out to the Android and it would fire off PAs back at
me.  Which intent belonged to which latlong was my problem to figure out.
I'm now thinking I need to keep each PA intent in a global data
structure^W^W^Winstance variable and carry them around with me and run an
RequestUpdate on each one. :-?

Is there someway for me to monitor myLocationManager to see when he fires
off a PA?







-- 

Faber Fedor
Linux New Jersey
 http://linuxnj.com 
faberfedor.blogspot.com

--~--~---------~--~----~------------~-------~--~----~



What's the trick to making ProximityAlerts work?

by Mark Murphy » Sun, 08 Mar 2009 09:17:41 GMT


 


Ah, sorry. FWIW, requestLocationUpdates() and addProximityAlert() should
be orthogonal -- the settings you supply requestLocationUpdates() should
not impact the behavior of addProximityAlert().


PAs? I'm guessing you mean proximity alerts, not Pennsylvanias or
precious armadillos or something.


I don't think so, by design. LocationManager is a system service; your
app does not even need to be running to get a proximity alert.

The first edition of my Android book had a sample app that used
proximity alerts. I dumped that sample app (after having to re-re-write
it due to the constantly-changing location API) and now my book does not
have a proximity alert sample. I'll see if I can work that into _Android
Programming Tutorials_, though.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
Android Training in Sweden --  http://www.sotrium.com/training.php 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


What's the trick to making ProximityAlerts work?

by Faber Fedor » Sun, 08 Mar 2009 09:27:07 GMT


 




I think there's still some connection between the two that I'm missing.




I noticed. :-)

The only example I've come across is WhereAmI.java which is based on a
previous SDK. I'm trying to glean the solution from that.

 For a "killer feature" of Android, there isn't much discussion or many
examples out there.




Another book?

-- 

Faber Fedor
Linux New Jersey
 http://linuxnj.com 
faberfedor.blogspot.com

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Can an Activity find out where it started from?

> BTW, I'm planning on buying your book..

Thanks!

I recommend the Warescription -- if you can live with PDF and Kindle
digital books, it's a much better deal than the print editions (three
books, plus any new titles and updates for a year):

http://commonsware.com/warescription

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~

2. Can an Activity find out where it started from?

Is there a way to do this?

Can you access the activity stack in a way to grab what activity came
before the one now in view?

I have a situation where an activity needs to know where it was
started from,
so it knows what data to display in that current activity.

Let me know,

Cheers,
Bill Y.

--~--~---------~--~----~------------~-------~--~----~

3. Time for some additional groups?

4. AppWidget: Irregular Id for Disable event

5. Difference between invalidate() and postInvalidate()

6. Difference between invalidate() and postInvalidate()

7. Android Manifest File ERROR and unable to see it?