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
Contributor
Posts: 23
Registered: ‎04-22-2010
My Device: 9000
My Carrier: Airtel

Implementing location fetch( lat, long) without GPS

[ Edited ]

Hi Is  there a way to fetch Latitude and Longitude of a device without using the inbuilt GPS in the device?

 

I have tried using the google maps api to fetch --> http://www.google.com/glm/mmap

 the api uses the cell ID and lac retrived using

cellId = GPRSInfo.getCellInfo().getCellId();
lac = GPRSInfo.getCellInfo().getLAC();

 

this provides me currect lat and long, but the method GPRSInfo.getCellInfo().getCellId();  does not consistently return me  a single value all the time and thus the lat and long fetched using google api  call also fails.

 

The second proble is this mechanism will not work for CDMA devices as they do not have cell id and lac,

CDMAInfo.CDMACellInfo.getBID()

CDMAInfo.CDMACellInfo.getSID()

CDMAInfo.CDMACellInfo.getNID()

Is there any way to get the latiude and longitude of a device using a data base for  bid  sid nid .

 

The google maps works fine for both gsm and cdma devices even without inbuilt gps.

 

Please give me suggestions regarding this issue.

 

thanks in advance

 

 

 

 

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Implementing location fetch( lat, long) without GPS

Since your device can switch between different cells, it's actually expected that getCellId may return different values at different times even when your phone is stationary.

Contributor
Posts: 10
Registered: ‎06-24-2010
My Device: 8900
My Carrier: student

Re: Implementing location fetch( lat, long) without GPS

can you tag your code for request the long and lat...that will help a lot...thanks...;p