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 7786231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:23:00+00:00 2026-06-01T20:23:00+00:00

My application uses gps location, but the request fails (time out error) every time

  • 0

My application uses gps location, but the request fails (time out error) every time if I stay inside of the building but location gets refresh well when I refresh the location from device Location Settings option if I stay in building too.

Here is my code

Criteria myCriteria = new Criteria();
myCriteria.setCostAllowed(false);
LocationProvider myLocationProvider = LocationProvider.getInstance(myCriteria);

Location myLocation = myLocationProvider.getLocation(((int)timeOutInMiliseconds/1000));
lastLatitude = myLocation.getQualifiedCoordinates().getLatitude();
lastLongitude = myLocation.getQualifiedCoordinates().getLongitude();
lastAltitude = myLocation.getQualifiedCoordinates().getAltitude();
lastAccuracy = myLocation.getQualifiedCoordinates().getHorizontalAccuracy();
lastSpeed = myLocation.getSpeed();

Please advise.

Ali

  • 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-06-01T20:23:01+00:00Added an answer on June 1, 2026 at 8:23 pm

    When you set the cost setting to false (myCriteria.setCostAllowed(false);), you set the GPS mode to be autonomous (the below table was taken from Location based services development guide – Criteria mapping properties.

    enter image description here

    Autonomous mode relies on GPS satellites only (see more about GPS modes here).

    This mode uses the GPS receiver on the BlackBerry device to retrieve location information. This mode cannot be used indoors or in close proximity to many physical obstructions, and it can take several minutes to fully synchronize with four or more satellites for the first GPS fix.

    That’s the reason why your request fails. Try using other GPS modes: assisted or cellsite.


    Assisted mode

    Assisted mode relies on GPS satellites and servers on the wireless network. This mode uses the wireless network to retrieve satellite information. This mode can achieve a fast retrieval of the first GPS fix.

    For assisted mode use this snippet (it is worth noting that there are several assisted modes):

    Criteria myCriteria = new Criteria();
    myCriteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_MEDIUM);
    myCriteria.setHorizontalAccuracy(100);
    myCriteria.setVerticalAccuracy(100);
    myCriteria.setCostAllowed(true);
    

    Cellsite mode

    Cellsite mode relies on the geolocation service, or the wireless network to provide the location information of the current base station. This mode uses the wireless network to achieve the first GPS fix, and is generally considered the fastest mode. This mode does not provide BlackBerry device tracking information such as the speed and the bearing.

    For cellsite mode use this snippet:

    Criteria myCriteria = new Criteria();
    myCriteria.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);
    myCriteria.setHorizontalAccuracy(Criteria.NO_REQUIREMENT);
    myCriteria.setVerticalAccuracy(Criteria.NO_REQUIREMENT);
    myCriteria.setCostAllowed(true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to simply acquire the user's GPS location, but my application crashes
I have an iOS application that uses GPS for Location Services. A user would
My application uses GPS updates while it is running and I would like that
I've written a mapping application which uses GPS. Testing this on my phone (a
My application uses some session variables that are timing out even though I thought
My application uses the Outlook object model. Outlook is an out-of-process COM server. Before
Our application uses an animation to fade out a message window when it's closed.
I'm writing an iPhone application that uses GPS data. My problem is that the
My application uses NHibernate with a session per request implementation. I have a core
I am making a application that uses the GPS receiver. The application will work

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.