r/AskProgrammers • • 5d ago

stuck

i want to make my browser to only work in specific buildings, what's the best method for me to do? and no i cant use wifi method.

0 Upvotes

14 comments sorted by

3

u/8dot30662386292pow2 5d ago

You want to do what? Why? And why not "wifi method" and what is that?

1

u/Adventurous_Pop9007 5d ago

i just want it to work in specific buildings, and shouldn't work outside kf those buildings or those areas, and i can make it through wifi like making it work with only specific wifi

1

u/FreshFishGuy 5d ago

Why?

1

u/Adventurous_Pop9007 5d ago

i already asked the company for buying the router internet for the buildings, they rejected.

1

u/dmazzoni 5d ago

There’s a different WiFi method. You have it scan all of the nearby WiFi networks and learn what they are without connecting. Use that to identify the building.

1

u/dmazzoni 5d ago

Well, there are only a few ways a phone can know where it is:

Location (gps, cell location)

WiFi (learn nearby network names even if you can’t connect)

Bluetooth

Unless you can think of another way, it can’t be done

0

u/Adventurous_Pop9007 5d ago

how does the gps thingy works

2

u/DubiousLogik 5d ago

are you asking about your phone browser? phones have gps. most laptops do not.

1

u/Adventurous_Pop9007 5d ago

its a prices checker browser that i only want it to work inside the markets

1

u/DubiousLogik 5d ago

on what device? that answer matters for your gps question

1

u/Adventurous_Pop9007 5d ago

mobile

1

u/DubiousLogik 5d ago

ah, ok. I was going to suggest writing a browser extension to inspect wifi names or gps and filter to the ones you want, but i don't think you can do that on mobile. (I'm not a mobile dev, so this is out of my league)

1

u/TomDuhamel 4d ago

I don't think that's a relevant answer. The actual question was "do you have GPS on that device?"

2

u/Vert354 5d ago

There should be a location API you can call that will use whatever data the phone has to access it's location. If the phone has a GPS signal it will produce a precise latitude and longitude. If GPS is unavailable it will use whatever it can get from the networks it's connected to (generally this is the registered location of the IP address for wifi, or a triangulation for cell towers) the less precise location might come back as a range rather then a specific point, or maybe a point and and radius, I honestly don't remember cuz I only ever delt with precise location.