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
New Developer
Posts: 10
Registered: ‎05-22-2009
My Device: Not Specified

Location API

Can any one please help me to understand :

 

1. If i implement Location Listerner and test on Simulator it works on 9000 but not on real device.

2. If i try to use getLocation Method it works on 9000 as well as simulator (9000) but does does not work on 9530. Any help will be greaty Appreciated,

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Location API

Is it only problem with LocationListener? Have you specified any criteria

Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 10
Registered: ‎05-22-2009
My Device: Not Specified

Re: Location API

Yes. i have tried every thing. Even i have tried GPSDemo on 9000, it does not work, but works on simulator for (9000)

Developer
Posts: 342
Registered: ‎02-04-2009
My Device: BB 8320

Re: Location API

Connect your device through usb and debug in simulator as following below:

 

Debug -> Attach to -> Handheld -> ur device 

 

Catch up the error what is causing your application to fail to get the location details.

 

Presently am also facing problem with this issue and found the below error:

java.io.IOException: Radio is off

 

Eventhough RadioInfo.getState() returns RadioInfo.STATE_ON status. 


Use Search. "Accept Solution" if the problem gets resolved.
Developer
Posts: 342
Registered: ‎02-04-2009
My Device: BB 8320

Re: Location API

I am using the following code to fetch the location details:

 

 

LocationProvider locationProvider = LocationProvider.getInstance(null);

locationProvider.setLocationListener(myLocationListener, -1, -1, -1);

 

public void loadLocationDetails(LocationProvider locationProvider, Location location) {

    speed = location.getSpeed();

    course = location.getCourse();

    Coordinates coordinates = location.getQualifiedCoordinates();

    if (coordinates != null) {

        longitude = coordinates.getLongitude();

        latitude = coordinates.getLatitude();

        altitude = coordinates.getAltitude();

    }

}

 

I can successfully simulate the GPS Location details and also able to fetch that in BB 9530 simulator. But, when I test it in device, it does not fetch the location details by returning the error, "java.io.IOException: Radio is off", eventhough I had choosed Allow option for the security prompt saying that "An application is trying to access the GPS location details, Do you want to allow?".

 

I have used try..catch all over my application, but it does not captured in any of these indicates, its thrown outside my application.

 

 Any suggestions?

 

Thanks. 

 

 


Use Search. "Accept Solution" if the problem gets resolved.
Highlighted
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Location API

Did you check with carrier is the GPS services activated on your device.

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 342
Registered: ‎02-04-2009
My Device: BB 8320

Re: Location API

[ Edited ]

Yes, in GPS settings LOCATION is set ON.

 

Do we can check this through application or need to ask the carrier only, whether the GPS is enabled for our device?

Message Edited by baskaraninfo on 22-05-2009 04:04 AM

Use Search. "Accept Solution" if the problem gets resolved.
New Developer
Posts: 10
Registered: ‎05-22-2009
My Device: Not Specified

Re: Location API

even though GPS is active on my device also.
New Developer
Posts: 10
Registered: ‎05-22-2009
My Device: Not Specified

Re: Location API

But this code does not work on Blackberry 9000 though it works on simulator for 9000.
Developer
Posts: 342
Registered: ‎02-04-2009
My Device: BB 8320

Re: Location API

@ BBDeveloper

 

In the GPS settings screen, I have set the LOCATION option to ON.

 

But, eventhough its not updating the latitude and longitude data on that screen. Does it indicates GPS facility is not supported by our carrier? 

 

@ niteshgaba

 

Does your latitude and longitude data are updated in the GPS settings screen? 


Use Search. "Accept Solution" if the problem gets resolved.