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: 367
Registered: ‎11-25-2009
My Device: Not Specified

BlackBerry Torch 9800 Geocode LocatorException

[ Edited ]

Hello,

 

For some reason, I cannot geocode locations on my BlackBerry Torch 9800 (6.0 Bundle 2647) device.  I am receiving a LocatorException.  Please note that I do not have a SIM card on the device, I am using WiFi only (but that shouldn't cause any problems).  I'm wondering if this is a device specific issue?  Here is my code, which works with no problem on other devices:

 

Error Information:

url: http://locate.blackberry.com/locate2/

desc: null

 

[0.0] Error Code: 5
[0.0] HTTP Code: 200
[0.0] Message: Item Not Found

 

 

public class myGeocode {

	private Thread geocoder;
	private ScreenLocation screen;
	private String addrInfo;

	public myGeocode(ScreenLocation screen, String addrInfo) {

		this.screen = screen;
		this.addrInfo = addrInfo;

		geocoder = new Thread(thread);
		geocoder.setPriority(Thread.MAX_PRIORITY);
		geocoder.start();
	}

	Runnable thread = new Runnable() {
		public void run() {
			try {
				Landmark[] results = Locator.geocode(addrInfo, null);
				
				screen.setLandmark(results);
				
			} catch (LocatorException lex) {
				Notify.inform(Constants.AKQA_ADDRESS_NOT_FOUND);
				System.out.println("Error Code: " + lex.getErrorCode());
				System.out.println("HTTP Code: " + lex.getHTTPCode());
				System.out.println("Message: " + lex.getMessage());
			}
		}
	};

}

 

I've tried geocoding many types of strings, all which face the same above problem:

 

20002

18508

scranton, pa 

etc.

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

Re: BlackBerry Torch 9800 Geocode LocatorException

[ Edited ]

As far as I am aware, this is a BlackBerry service and so only available for people using BlackBerry plans.

 

But I have never tested this.  Can you try your code on a 'real' BlackBerry to see if it makes any difference?

Developer
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: BlackBerry Torch 9800 Geocode LocatorException

Hi peter_strange,

 

By "real" BlackBerry (one with a BlackBerry plan), are you referring to a data plan from a mobile carrier like Verizon or AT&T?  Assuming that is the case, I unfortunately will not be able to test this.  I have a SIM card for one OS 7.0 phone, but I am unable to transfer it to the OS 6.0 Torch without an unlock code.  

 

Thanks!

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

Re: BlackBerry Torch 9800 Geocode LocatorException

In that case I think you might find that you will not be able to test it.

 

But have a look at this:

https://developers.google.com/maps/documentation/geocoding/

 

Might give you a way to do what you want.  Check the terms and conditions mind....