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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 220
Registered: ‎09-09-2008
My Device: Bold 9780
My Carrier: Telstra AU

Location via Cell Tower rather then GPS

Hi all,

 

Im trying to locate the device by using the Cell tower solution rather then the gps as im only interested in the estimated location of the user.

 

try {

            Criteria criteria = new Criteria();

            criteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT);

            criteria.setVerticalAccuracy(Criteria.NO_REQUIREMENT);

            criteria.setCostAllowed(true);

            criteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);

            criteria.setAddressInfoRequired(false);

            criteria.setAltitudeRequired(false);

            criteria.setSpeedAndCourseRequired(false);

            

            locationProvider = LocationProvider.getInstance(criteria);

            

            if(locationProvider != null){

                System.out.println("LocationProvider");

                Location myLoc = locationProvider.getLocation(-1);

                

                lon = myLoc.getQualifiedCoordinates().getLongitude();

                lat = myLoc.getQualifiedCoordinates().getLatitude();

            }

}catch(Exception e){ System.out.println(e.toString()); }

 

The problem with the above code is that the locationProvider is always null.

 

I also tried to set the criteria only for power consumption and  cost allowed, but still no luck.

 

Im tried it on the simulator for the Bold 4.6 and i used a real device Bold running 4.6 with Vodafone, but still get the same issue...

 

Any help appreciated .... 

 

 

-----------

Follow me on twitter: twitter.com/paul.haenel

If your issue is resolved, please mark this thread as solved.

Set the "Solution" mark on the post which contains the answer to your question.
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Location via Cell Tower rather then GPS

you have to implement it yourself, the locationprovider can not work with celltower ids.
use the search power, there have been several similar questions. it all runs down to having a celltower id lookup table.
----------------------------------------------------------
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
Highlighted
New Developer
Posts: 17
Registered: ‎05-01-2009
My Device: Not Specified

Re: Location via Cell Tower rather then GPS

Some kind of location data is comming back through the SUPL response, but I haven't deciphered it yet.  I guess it's possible that the SUPL service doesn't return enough data to get a fix.

 

But, that doesn't explain why the Blackberry mapping application gets a quick first fix.  it's within 1200 meters, which is good enough for my first fix.