Troubleshooting guide
207
14: Using location information
private static float[] _altitudes;
private static float[] _horizontalDistances;
private static PersistentObject _store;
// Initialize or reload the persistent store.
static {
_store = PersistentStore.getPersistentObject(ID);
if(_store.getContents()==null) {
_previousPoints= new Vector();
_store.setContents(_previousPoints);
}
_previousPoints=(Vector)_store.getContents();
}
private long _startTime;
private float _wayHorizontalDistance;
private float _horizontalDistance;
private float _verticalDistance;
private ListField _listField;
private EditField _status;
private StringBuffer _messageString;
private String _oldmessageString;
private LocationProvider _locationProvider;
private ServerConnectThread _serverConnectThread;
private final class GPSDemoScreen extends MainScreen
{
protected void makeMenu(Menu menu, int instance)
{
menu.add( _markWayPoint );
menu.add( _viewWayPoints );
menu.add( _options );
menu.add( _close );
menu.addSeparator();
super.makeMenu(menu, instance);
}
public void close() {
if ( _locationProvider != null )
{
_locationProvider.reset();
_locationProvider.setLocationListener(null, -1, -1, -1);
}
if ( _serverConnectThread != null )
{
_serverConnectThread.stop();
}
super.close();
}
}
/* Instantiate the new application object and enter the event loop.
* @param args unsupported. no args are supported for this application
*/
public static void main(String[] args) {
new GPSDemo().enterEventDispatcher();