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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:51:03+00:00 2026-06-08T00:51:03+00:00

I have an HTML app, not a native app. It’s like a website, and

  • 0

I have an HTML app, not a native app. It’s like a website, and I access a url with my mobile device, like a website. And geolocation doesn’t work. It’s a Phonegap app. I have: index.html, cordova-1.9.0.js, and two .js that contain the functions.

I posted my problem of not obtaining the coordinates on the Phonegap group of Google, and Simon Mac Donald answered me that I was doing it all wrong, but he was busy and told me that he would answer me later…

Now, I visit my post, but no updates. Could anyone explain to me a little?
Thanks very much, Daniel

  • 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-08T00:51:04+00:00Added an answer on June 8, 2026 at 12:51 am

    PhoneGap is for native apps. You write code in HTML, Javascript and CSS, add a link to the cordova/phonegap.js file and then compile it to one of the supported platforms (iOS, Android, Winphone, etc). The end result is a native application.

    You cannot use PhoneGap or any of its functionality in a web app.

    Now, location services can be used in a web app because it is provided by all modern browsers. The object you need is window.navigator.geolocation. Here’s a sample of how to use it (using watchPosition() based on your comment). Capturing error can help you track down why it’s not working for you.

    Demo (code): http://jsfiddle.net/ThinkingStiff/UZwdv/

    Demo (open on your phone): http://jsfiddle.net/ThinkingStiff/UZwdv/show/

    Script

    var location = document.getElementById( 'location' );
    
    var geo = window.navigator.geolocation.watchPosition( function ( position ) {
            location.textContent = position.coords.latitude  + ', ' + position.coords.longitude;
        },
        function ( error ) {
            location.textContent = error.message;
        }
    );
    
    //later if you want to cancel it
    window.navigator.geolocation.clearWatch( geo );
    

    HTML

    <div id="location"></div>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For instance, I have a url like this : www.mysite.com/my_app.html How do I pass
I am building Javascript application for mobile browsers (not wrapped-as-native app). I noticed that
I have an HTML (App) file that reads another HTML (data) file via jQuery.ajax()
I have a html wrapper app loading all js, css and images from ipad
I have an HTML file which is launching an app if I open it
http://developer.android.com/tools/publishing/app-signing.html I have a keystore that I already have an alias and password for.
http://www.kidzoneapp.com/uses.html In this app, they somehow have an ability to protect users home button
I have in my app/views/bar/index.html.haml the following %p= render partial: 'foo', collection: @foos the
I have a bunch of html files that come with my app and are
I have a couple of html forms inside of an Android app. To hide

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.