×

Discussion Board

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

    Question Does Location Listener update references to Location Provider?

    Hi, I am currently retrieving coordinates from the GPS and storing the value in a global variable called GLOBAL_QC. After the coordinates are stored I set the Location Listener for the Provider. However when the location has been updated it changes the value of my global variable to the new coordinates even though I did not say to do so. Only one function call is made to the method in which i set the global variable.

    // 1. Retrieving coordinates and setting it to a variable GLOBAL_QC
    --------------------------------------------------------------------
    try{
    location = locProvider.getLocation(-1);
    if(location.isValid())
    {
    GLOBAL_QC = location.getQualifiedCoordinates();
    }
    locProvider.setLocationListener(new LocationListenerImpl(),1, 1, 1);

    }catch(Exception e){
    e.printStackTrace();
    }

    //2. Location Updated method does nothing
    -----------------------------------------------------------------
    private class LocationListenerImpl implements LocationListener
    {
    public void locationUpdated(LocationProvider provider, Location location)
    {}
    }

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

    Re: Does Location Listener update references to Location Provider?

    Anyone. Please help?

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: Does Location Listener update references to Location Provider?

    Hi,

    If I have understood your question clearly, the answer is yes. Once you start listening location you get update.

Similar Threads

  1. Getting the location of a Nokia Series 60, N80 phone
    By xgamerx in forum Mobile Java General
    Replies: 12
    Last Post: 2008-02-15, 05:01
  2. where is python location on mobile phone
    By lb213_2000 in forum Symbian
    Replies: 1
    Last Post: 2007-11-05, 08:56
  3. Location to select Network Provider
    By jose_79 in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2006-04-27, 12:15

Posting Permissions

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