BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-14-2009, 10:17 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question AddressInfo Is Null

Please Login to Remove!

Hello Everyone

I have following piece of code. The AddressInfo is null all the time on the actual device. I get Latitude and Longitude.

public void locationUpdated(LocationProvider provider, Location location)
{
if(location!=null && location.isValid())
{
QualifiedCoordinates coordinates = location.getQualifiedCoordinates();
AddressInfo adInfo = location.getAddressInfo();
}
}

Any ideas why?

Thanks
Offline  
Old 05-14-2009, 12:54 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

First, please read this sticky thread on how to paste formatted code.

Code:
public void locationUpdated(LocationProvider provider, Location location)
{
    if(location!=null && location.isValid())
    {
        QualifiedCoordinates coordinates = location.getQualifiedCoordinates();
        AddressInfo adInfo = location.getAddressInfo();
    }
}
Second, from my read of the java doc page for javax.microedition.location.AddressInfo, it is only a container. The values have to be set by some other facility.
Quote:
This class is only a container for the information. The getField method returns the value set for the defined field using the setField method. When the platform implementation returns AddressInfo objects, it MUST ensure that it only returns objects where the parameters have values set as described for their semantics in this class.
And javax.microedition.location.Location.getAddressInf o() has the following note in the documentation:
Quote:
This method returns null because the RIM implementation does not support textual address.
__________________
My other Blackberry is a PlayBook.

Last edited by hrbuckley : 05-14-2009 at 12:59 PM.
Offline  
Old 05-14-2009, 02:43 PM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 9530
PIN: N/A
Carrier: Telus
Posts: 107
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi hrbucklet

Sorry about posting code like. Did not mean to.

So, how do I go about maping the coordinates to the address?

Thanks
Offline  
Old 05-14-2009, 04:11 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

I suspect you would need access to a database that mapped one to the other. I don't know where you would get such access, I'm fairly certain it wouldn't fit on a BlackBerry.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 05-14-2009, 09:14 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You need to access a geocoding service. Google has one, I believe.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.