Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 820701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:31:14+00:00 2026-05-15T02:31:14+00:00

I am working on gps based application. I am using LocationProvider and calling setlocationListener

  • 0

I am working on gps based application. I am using LocationProvider and calling setlocationListener through it code is like


   LocationProvider lp = LocationProvider.getInstance(null);
        if (lp != null) {
            lp.setLocationListener(new LocationListenerImpl(), 2, 1, 1);
        } else {
            Dialog.alert("GPS NOT SUPPORTED!");
            retval = false;
        }
    } catch (LocationException e) {
        System.out.println("GPS Error: " + e.toString());
    }

    return retval;
}

private class LocationListenerImpl implements LocationListener {
    public void locationUpdated(LocationProvider provider, Location location) {
        if (location.isValid()) {
            heading = location.getCourse();
            longitude = location.getQualifiedCoordinates().getLongitude();
            latitude = location.getQualifiedCoordinates().getLatitude();
            altitude = location.getQualifiedCoordinates().getAltitude();
            speed = location.getSpeed();
            System.out.println("Current latitude:"+latitude);
            System.out.println("Current longitude:"+longitude);
            System.out.println("Current speed:"+speed);

            // This is to get the Number of Satellites
            String NMEA_MIME = "application/X-jsr179-location-nmea";
            satCountStr = location.getExtraInfo("satellites");
            if (satCountStr == null) {
                satCountStr = location.getExtraInfo(NMEA_MIME);
            }

            // this is to get the accuracy of the GPS Cords
            QualifiedCoordinates qc = location.getQualifiedCoordinates();
            accuracy = qc.getHorizontalAccuracy();
        }
    }

it doesnt give an error but dont even work out so help with the same.the control dont get transferred to LocationListenerImpl()…
I am using BlackBerry_JDE_PluginFull_1.0.0.67 with eclipse-java-galileo-SR1-win32 on Blackberry 8800 simulator..
Any assistence is grately appreciated….
Thanking you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:31:15+00:00Added an answer on May 15, 2026 at 2:31 am

    try this:

    lp.setLocationListener(new LocationListenerImpl(), 2, -1, -1);
    

    Acc to me
    u set 2,1,1 which means that time interval is 2 sec after which location updation will be automatically called
    1 sec indicates time out
    1 sec indicates max age

    ur gps times out before going ahead for gps location update method.so try it with setting it to default value = -1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a GPS data logger and Map viewer application using Microsoft
Working on a tracking application using GPS. It is all fine, but sometimes because
I have spent last 3 days until I got gps working on android using
I have a working application which gets the GPS Long/Lat of from a BlackBerry
I am working on an application which works with GPS data. Part of the
I'm working on an iPhone app that is using GPS coordinates for leaderboards. I
I'm working on an application that shows the position of vehicles based on the
I am working on a simple GPS-like app. I created a custom object which
I am new to PHP, and am working on a GPS tracking system. I
I am working on geolocation application in that I want to use Gps provider

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.