Ai Dreams Forum

Member's Experiments & Projects => AI Programming => Topic started by: yotamarker on October 04, 2021, 03:16:45 pm

Title: where does the computer store the users location
Post by: yotamarker on October 04, 2021, 03:16:45 pm
so I built this java function to get the GMT of the computer, which requires the computer to know in which country/city it is

and I wonder how it has that info to begin with
Title: Re: where does the computer store the users location
Post by: ivan.moony on October 04, 2021, 04:13:37 pm
On mobiles there should be a programming library to access the location (if user allows that).

On desktops, I believe, things are a bit trickier. There is no standard across operating systems that defines user location. On the contrary, that could be considered harmful, considering user privacy. But, there should be a way for detecting an IP address of a computer connected to the web. That IP address is connected to some web provider, and IP of the provider could be enough to narrow down the location of connected computer. I think this is what Google Search does. But on my desktop, it took several years, first to track down my country, then to track down my city, then to track down my location more precisely. But it was never showing my precise address (I bet not to scare me). I guess visiting some sites from Google Search and setting up my Google Mail account helped in tracking me down pretty much accurately.

But be careful, users usually don't like to give away their private info such are their exact location. I'm having this issue with Google. I'm uncomfortable for it knowing where I'm located. Not that I have to hide something, but it just feels wrong for the big brother watching me from the above. Yuck.
Title: Re: where does the computer store the users location
Post by: Don Patrick on October 04, 2021, 04:35:03 pm
The computer doesn't store the location. The computer stores the IP address, which can be traced to a location using an online API service. However, the accuracy greatly depends on the service and the user's network provider. Websites will often assume I live in the capital of my country because they can't pinpoint the exact town, or they get the wrong town because my provider happens to have its main server there. They do get the country right, because there's a country code in the IP address. There are Javascript functions to get the user's IP address, I assume Java also has such a function.
Title: Re: where does the computer store the users location
Post by: WriterOfMinds on October 04, 2021, 04:45:58 pm
so I built this java function to get the GMT of the computer, which requires the computer to know in which country/city it is

In my experience, a desktop or laptop computer's time zone is not based on knowledge of its physical location. The time zone is chosen by the user during setup and can be changed arbitrarily thereafter. I have carried computers across time zone boundaries and connected them to the internet there without seeing the reported time change.

I think mobile devices can sometimes update the time zone by using geolocation.

Fully updated, internet-connected Windows 10 PCs provide local weather reports based on a location that you can set in the weather dashboard. It tries to detect your location automatically -- I suspect using the IP address, as described by others in the thread -- but you can also set it to something else.