0

I'm trying to get location through java application via GPS and I found it not useful , most computers don't have GPS sensor , so I've tried to get it online , I had found a way by HTML code reading Latitude and Longitude (CODE below ) , now I need to attache this code into my java application !

so in steps

  1. I Need to convert this value of Latitude and Longitude into a place
  2. Save This result
  3. Get the result into my Java Application

also I want to ask if it's possible to do all of this things implicit without opening the browser(or open it in background).

I'll be so grateful for your help

HTML CODE>>

<!DOCTYPE html>
<html>
<body>

<p>Click the button to get your 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 is not supported by this browser.";
   }
 }

function showPosition(position) {
    x.innerHTML = "Latitude: " + position.coords.latitude + 
     "<br>Longitude: " + position.coords.longitude; 
}
 </script>

 </body>
 </html>
m.yuki
  • 815
  • 1
  • 10
  • 19
  • Could you please show us what you've tried? We will help you work through problems with your code, but we won't write code for you (except in editing what you've provided). – Shotgun Ninja Sep 25 '15 at 20:10
  • i don't have an error or misconception of what i need , i am just don't know how to do it :\ ! – m.yuki Sep 25 '15 at 23:00

0 Answers0