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
Highlighted
Developer
Posts: 141
Registered: ‎08-06-2008
My Device: Not Specified
Accepted Solution

Location base information

Hi all,

 

Is there any way to get current my location information?

Like I would like to get City information where I'm from api.

 

Thanks,

DK.

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

Re: Location base information

you can get your coordinates. to get the city you have to use an external service. google offers services like this.
----------------------------------------------------------
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: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Location base information

If you want to roll-your-own, you do have several options.

 

There is some hope in using the cell information to get tower information if you don't have GPS or triangulation

results from your carrier. However, you need a table for converting codes to location. The FCC has some

public documents that relate call sign to registration information including tower location but these don't

appear to be mapped directly into things you can use ( never provide free information when you can hide it).

 

If you manage to get lattitude and longittude, there "should be" various tables you can use to download and manipulate

into your own database. Typing the terms into google turns up a bunch of tables of city locations. If you find a zipcode

table I would appreciate it if you could post a link as I never found one on an earlier quick search ( lat/long or post offices

by zip).

 

Thanks.

 

 

Developer
Posts: 141
Registered: ‎08-06-2008
My Device: Not Specified

Re: Location base information

Hi,

 

I saw a class that called Location. Is this related location base?

Do you have more detail information?

 

Thanks,

DK.

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Location base information

IIRC it is LocationProvider but search the docs for "location" and you should find the info. You get r,theta, and phi ( lat/long/maybe altitude).

It is up to you to related that to landmarks but there are plenty of related tables.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Location base information

There seem to be some cross purposes here, can I clarify what I believe to be the question.  I'm not an expert on this, so there are probably some inaccuracies/simplifications in the following, but I hope it makes sense. 

 

The BlackBerry has the ability to provide a Location (that is an Object of the type Location) to an Application program.  This location is really just positioning information, i.e. latitude and longitude, with a few other bits of interesting stuff thrown in (like speed).  So the BlackBerry knows exactly where you are - and you can use this information to display a map of where you are using BlackBerry Maps.

 

However a GPS location is pretty useless when it comes to finding your way around.  An Address is what you really want.  The process of converting a location to an Address is called geo-coding.  To do it, you really need to have a table that matches addresses to locations and the other way round.

 

I believe there are a number of map suppliers that will do this for you, including Google, but I've not looked.  However my colleagues, who have looked for the UK, have not found a service that is free.

 

So to summarize dkksunkim, I think you are looking for a geo-coding service, and I don't believe one exists on the BlackBerry.  I think you will have to code some sort of API to a Web based service to do this.  Hunt round for a supplier of maps for your area and ask them, or hunt round Google for it.

 

Hope this helps.

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

Re: Location base information

i can refer to this article that should cover most questions (and may be interesting for others as well):
http://www.anddev.org/poor_mans_gps_-_celltowerid_-_location_area_code_-lookup-t257.html
----------------------------------------------------------
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: 141
Registered: ‎08-06-2008
My Device: Not Specified

Re: Location base information

Hi simon_hain,

Thank you so much. 

I got what I need to do for what I want. This is good information for me.

 

Thanks,

DK.

Developer
Posts: 141
Registered: ‎08-06-2008
My Device: Not Specified

Re: Location base information

Peter,

 

I thought I got some clue on this but I'm still looking for a way to get longitute an latitute without using GPS in blackberry.

 

Can I get longitute and latitute by device without GPS?

Could you provide me an example code?

 

Thanks,

Doug.

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Location base information

In theory, the locationprovider should provide something that matches your constraints or preferences,

GPS or not. The other approach that is normally available is cell tower based on carrier assistance.

The javadocs provide, IIRC, RIM implementation notes explaining what you could get from a set of constraints

( if you use the most liberal, you should get something if anything is available).

This is supposed to be mandated for things like 911 assistance and is probably available if you complain

( mine started working after complaining- just mention you are a developer ).

 

The gps demo that comes with some JDE's is easy to modify to remove the server requirement and contains

the relevant code.