Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone
Accepted Solution

How to use LocationCoder

my location provider code snippet isnt working. I have imported the requisite packages.But it gives an error this method is not applicable for these parameters. i have no clue what this error means

{lp = LocationProvider.getInstance(null);
lp.setLocationListener(ll, 1, 1, 1);}

 

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to use LocationCoder

is "ll" a locationlistener?
these values won't give you very useful data in any case, but 1/1/1 should be valid.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 81
Registered: ‎12-04-2012
My Device: BlackBerry@8520 smartphone(Edge,Wi-fi)
My Carrier: vodafone

Re: How to use LocationCoder

ll is a locationlistener,,it isnt working either ways .how are we supposed to use one.Could u guide .
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified
Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha
My Carrier: Roger

Re: How to use LocationCoder

LocationProvider provider = LocationProvider.getInstance(null);
  if (provider != null) {
    provider.setLocationListener(new LocationListenerImpl(), 1, -1, -1);
   } 

 

private class LocationListenerImpl implements LocationListener {

 

           public void locationUpdated(LocationProvider provider, Location location) {

                         ................

            }

 

           public void providerStateChanged(LocationProvider provider, int newState) {

                     ........................

            }

......

 

}