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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:37:29+00:00 2026-06-13T09:37:29+00:00

I am building an app using PhoneGap. While using the Geolocation API of phonegap

  • 0

I am building an app using PhoneGap. While using the Geolocation API of phonegap I realized that the APIs time out for two reasons and the same error is thrown:
1. If GPS is not enabled on the user’s device
2. If GPS is enabled and is not able to get the location of the user (could be several reason, faulty GPS, unclear weather and so on)

I am having an issue in differentiating the cause? Any thoughts on how to do it?

I was wondering if there is any way, I can check if GPS is active on user’s device using Phonegap, so that i can do that as a separate check and direct user to the settings window where typically GEO settings are placed. Not sure how to do that? a custom phonegap plugin may be?

  • 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-13T09:37:30+00:00Added an answer on June 13, 2026 at 9:37 am

    You could check the error code in PositionError parameter of geolocationError in your call to getCurrentPosition. I am guessing that it will be PositionError.PERMISSION_DENIED when gps is not enabled, and PositionError.POSITION_UNAVAILABLE or PositionError.TIMEOUT when gps is enabled but there are other issues.

    Note that this is platform dependent. You would probably have to write a contrived error message that says “Could not get the current position. Either GPS signals are weak or GPS has been switched off”.

    One thing you can try is to call getCurrentPosition with an incredibly small timeout, say 1 ms. If it says permission denied, you can conclude that gps is disabled and if it times out, you can assume that gps is enabled. I do not have time to test this, you could probably edit this answer with result of your tests.

    Another thing you can try is to use the diagnostic phonegap plugin for android. You will have to make sure you use the plugins for the other platforms also, but they are all also mostly there.

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

Sidebar

Related Questions

I am building a mobile app using the Channel API (in phonegap). However, I
BACKGROUND: I am running a phonegap app that I am building using phonegap build
I am building a small app using PhoneGap HTML/CSS. Now my problem is that
I am building an Android app using phoneGap and I have successfully added the
I'm building an hybrid Android App using Phonegap/Apache Cordova. My app should get data
I'm building an app using Phonegap and I'm using Urban Airship for iOS and
I am building an iPhone App using PhoneGap. I am using ChildBrowser plugin. If
I'm building an app in html/css/javascript and using phonegap to build. So, I first
I am building an app using Phonegap and JQuery. The app stores ( using
I am building an phonegap app using html5 and css. I have a iBall

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.