java - How to include HTML GPS location result into JavaSE application -


i'm trying location through java application via gps , found not useful , computers don't have gps sensor , i've tried online , had found way html code reading latitude , longitude (code below ) , need attache code java application !

so in steps

  1. i need convert value of latitude , longitude place
  2. save result
  3. get result java application

also want ask if it's possible of things implicit without opening browser(or open in background).

i'll grateful

html code>>

<!doctype html> <html> <body>  <p>click button coordinates.</p>  <button onclick="getlocation()">get location</button>  <p id="demo"></p>  <script> var x = document.getelementbyid("demo");  function getlocation() {    if (navigator.geolocation) {        navigator.geolocation.getcurrentposition(showposition);    } else {       x.innerhtml = "geolocation not supported browser.";    }  }  function showposition(position) {     x.innerhtml = "latitude: " + position.coords.latitude +       "<br>longitude: " + position.coords.longitude;  }  </script>   </body>  </html> 


Comments