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
Visitor
Posts: 1
Registered: ‎04-09-2013
My Device: 9780
My Carrier: 447530365994

Blackberry GPS Unresponsive

[ Edited ]

I have an application which quite frequently polls GPS, logs the data to a server. This application is working.. most of the time, on a range of models and OS builds (as old as 8800 up to more recent 9320).

 

However, sometimes it appears possible for the GPS functions on the Blackberry itself to become unresponsive, by which I mean that no fix will be provided to my application through the registered location listener object. In the options>device>location settings menu, the "Refresh GPS" option times out unable to obtain a fix. The hidden system test menu (device>status information>type test) likewise times out unable to access the GPS.

 

To be clear, the issue is not simply lack of GPS coverage in my location. I have several test devices, of which all or most will be working at any given time. I have a GPS repeater aerial stationed mere metres from my desk.

 

I am not sure if this failure mode is due to some action my application has performed, however it seems severe to completely device-wide disable GPS functions. The only snippet I've been able to glean from the event log is the following, which seems to suggest the cause of the lack of fix capability - a fix is "in progress". 

 

Name Location API. Severity Warning.

"Stop GPS - Skipped: Single fix still in progress for mode:1"

 

Note, mode 1 is "GPSInfo.GPS_MODE_ASSIST" which I am using for this application.

 

In older versions of my app I have had to manually reset the location provider to re-enable the GPS capability when this kind of situation happened, however in the more recent API I have made use of the BlackBerryCriteria.setGPSRestartInterval setting. I had hoped this would enable the OS to take care of this kind of micro management, resetting of the GPS stack does not seem like something for which an application developer should be responsible, however here we are.

 

I wonder if I have violated some sacred rule of best practice which is causing these problems, I will drop some code snippets in here. Of course, it will be tough to understand the flow of my application without all the source, and I don't expect that would be wanted anyway, however if there is some suggestion anybody can make I will be grateful to hear it.

 

// Instantiate criteria object
c = new BlackBerryCriteria (); c.setMode(GPSInfo.GPS_MODE_ASSIST); c.setGPSRestartInterval(600, 3);

 

// Later instantiate listener and start listening for GPS from the provider.
// _interval is 5. Too short? I am going to test larger values. -1 and -1 use default times for timeout and max life

private void startLocationUpdates()
{
    try {
        _locationProvider = (BlackBerryLocationProvider)LocationProvider.getInstance(c);
        _Listener = new LocationListenerImpl();
        _locationProvider.setLocationListener(_Listener, _interval, -1, -1);
    }
    catch (Exception e) {
         setStatusMessage("GPS Not supported");
    }
}

 

// On certain activities a thread is spawned to pause location updates for a defined interval
_locationProvider.pauseLocationTracking(_interval);
Thread.sleep(_interval-30000);
_locationProvider.resumeLocationTracking();

 

EDIT:

 

Approx 102 minutes after the last valid fix I see the following eventLog entries repeating every 5 minutes, but still nothing received in my application. Probably relevant? :

 

guid:0x277D769E659B97FD time: Tue Apr 09 15:50:20 2013  severity:4 type:2 app:Location API data:Stop GPS -  process removed and all GPS session terminated for mode:1
guid:0x277D769E659B97FD time: Tue Apr 09 15:50:22 2013  severity:4 type:2 app:Location API data:Starting location update for:276 and mode:1
guid:0x277D769E659B97FD time: Tue Apr 09 15:50:22 2013  severity:4 type:2 app:Location API data:Start GPS - Multiple fix for application:276 with mode:1

 

 

Thanks,

 

Dan.