×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    7

    Question Does ProximityListener rely on Location Listener

    Im interested to know if a proximity listener events depend on triggers of a location listener OR Is it that a proximity listener has similar characteristics to a location listener in that it periodically queries the location provider for updated coordinates in order to compare with the coordinates stored to trigger the proximity event method?

    If so then is it that the difference between the two are simply in its methods and parameters?

    Note : I understand how to use both listeners, just want some information on the internal workings.

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: Does ProximityListener rely on Location Listener

    Quote Originally Posted by kbelcon View Post
    Im interested to know if a proximity listener events depend on triggers of a location listener OR Is it that a proximity listener has similar characteristics to a location listener in that it periodically queries the location provider for updated coordinates in order to compare with the coordinates stored to trigger the proximity event method?

    If so then is it that the difference between the two are simply in its methods and parameters?

    Note : I understand how to use both listeners, just want some information on the internal workings.


    Hello kbelcon,

    I was interested if you had some specific implementation in mind while you brought this question up...?

    So, Location API gives you the ability to know whether a particular mobile use is within
    proximity of a particular location. ProximityListener Interface has to be implemented
    to track the proximity event.

    The ProximityListener itself has two methods to be overridden:

    monitoringStateChanged(boolean isMonitoringActive) :
    To notify that the state of the proximity monitoring has changed.

    proximityEvent(Coordinates coordinates, Location location):
    Your code for tasks to be done when the user comes into proximity to a particular location.

    This listener is registered to LocationProvider by calling its static method addProximityListener().

    addProximityListener(ProximityListener listener, Coordinates coordinates, float proximityRadius)

    listener: Class implementing ProximityListener Interface.
    coordinates: coordinates for which proximity is checked.
    proximityRadius: The radius in meters which forms the arc around the coordinates registered.

    So the dependency is from proximity listener to location provider.

    Please let me know if you found this information useful...?

    With Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    7

    Re: Does ProximityListener rely on Location Listener

    Hi Mark, I do understand this. What i would like to know however is exactly how the proximity listener is triggered. I understand that it occurs when the user is within the supplied range of the set coordinates, however how does this work? Does the proximity listener keep querying for location updates internally?

    What i am intending to do is as follows :
    User is located at the middle of a circle which is say position X. While moving if the user comes within 50ft from the circumference of the circle an automatic event is triggered. My problem is setting proximinitylisteners for each point in the circumference which I see as inefficient and bulky.
    Last edited by kbelcon; 2010-03-23 at 20:36.

  4. #4
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: Does ProximityListener rely on Location Listener

    Hi,

    The ProximityListener receives updates based on terminal crossing into a defined radius (radius of a circle is the distance from the center of a circle to any point on the circle) around a coordinate.

    The LocationProvider lets to register multiple ProximityListeners. Listening proximity events from several different locations (e.g. buildings) triggered by using multiple registrations with listener, coordinates and the required proximity radius from these coordinates.

    "Does the proximity listener keep querying for location updates internally" = afaik, Yes.

    (If someone has better information on this, please edit & correct?)

    "User is located at the middle of a circle which is say position X. While moving if the user comes within 50ft from the circumference of the circle an automatic event is triggered."

    So in your case the user would not be crossing-into a circle defined by a radius for a given location, but is within the circle and when moves closer to the circumference of it, say about 50 ft, then your event would be triggered - is this what you meant? So basically X would be "about to leave" the area?


    Cheers,
    Last edited by Maveric; 2010-03-23 at 22:14.
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  5. #5
    Registered User
    Join Date
    Feb 2009
    Posts
    7

    Re: Does ProximityListener rely on Location Listener

    Well i do understand the entire concept of ProximityListeners now which is perfect. How would you go about setting proximitylisteners for an entire radius (360 degrees) so if a user comes close to any point an event is triggered.

  6. #6
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Does ProximityListener rely on Location Listener

    It's not about triggering the notification on any point, but on a specific point's proximity. And the radius would be measured in meters and not in degrees. http://en.wikipedia.org/wiki/Radius

    I would really check the SDK docs again. The earlier discussions about the ProximityListener which can be fond on this forum indicate that the feature is not actually implemented. It may have been added in some recent releases but one should check that before spending more time discussing implementation details.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    3

    Re: Does ProximityListener rely on Location Listener

    Quote Originally Posted by kbelcon View Post
    Well i do understand the entire concept of ProximityListeners now which is perfect. How would you go about setting proximitylisteners for an entire radius (360 degrees) so if a user comes close to any point an event is triggered.

    I think you are looking at it the wrong way... Why not simply check distance ( radius) from a specific point ( the origin of your cicle)? Now your only checking one point instead of a geometricly infinite range of points.


    des

Similar Threads

  1. remove location listener
    By golzari_ali in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2009-09-14, 09:07
  2. Decompress then save again as contact to phone book, it is possible?
    By bytescode in forum Mobile Java Tools & SDKs
    Replies: 8
    Last Post: 2009-08-31, 16:04
  3. Who knows the Location Listener's lifecycle in details?
    By livelocus in forum Mobile Java General
    Replies: 1
    Last Post: 2009-07-13, 08:24
  4. s60 3rd ed emulator crash
    By Kimau in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-06-18, 22:12
  5. where is python location on mobile phone
    By lb213_2000 in forum Symbian
    Replies: 1
    Last Post: 2007-11-05, 08:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×