Is there any way to get the GPS Location in KMP De...
# compose-desktop
c
Is there any way to get the GPS Location in KMP Desktop? I can’t find any information on this. I can use compose-web and bridge to the javascript location API, but there doesn’t seem to be a way to access this from the desktop app. Any clues?
z
m
The first question however is, where do you want to get the GPS data from? Typical desktop computers don’t have GPS signal receivers and thus there is normally also no API to read that data. What you can do is buy a GPS mouse and attach it to an USB port (used as serial port) and via
Copy code
implementation("net.sf.marineapi:marineapi:0.12.0")
implementation("com.fazecast:jSerialComm:2.10.4")
you can then read the data via the NMEA protocol.
👍 1
c
Mac laptops have GPS sensors and used for many things. I can handle the iOS and Android and even web with no troubles at all, but the MacOS Desktop target is very limited in choices, it seems. When Sonoma and Ventura changed permissions handling, it broke all the previous solutions (which there were many.)
m
Show me any Mac laptop with a built-in GPS chip.
Copy code
Many websites and applications need to use your Mac's location to function at their best. While your Mac doesn't have a GPS, location can be determined from Wi-Fi based on your IP address. You simply have to ensure Location Services are turned on.
1
z
I've also just come across this library: https://compass.jordond.dev/docs
❤️ 1
👍 1
c
I’m talking to the owner of that repo, as it doesn’t yet allow api access to the GPS location, even though it has it internally. He says he will be pushing out an update for this, as he sees the need for this functionality.
The mac gps lookup uses all kinds of things to determine location, but the API is not exposed unless running within an application container. Will there be some kind of bridge for compose-desktop apps to access these API’s without third party apps being installed?
The maintainer of the Compass repo (https://compass.jordond.dev/docs) says he has added the location feature and will be pushing out an update. The code is available now, I saw the merge and documentation update.
@Michael Paus Most modern mac laptops all have GPS chips in them. I dont know of any that don’t at this juncture.
m
Show me any technical spec from Apple which states that any mac laptop has a built-in GPS receiver. Actually you said it already yourself. “The mac gps lookup uses all kinds of things to determine location”. Your wording is wrong. What you are talking about is the macs location service but not GPS which is one specific technology for a satellite based location service. GPS does NOT lookup all kinds of things to determine location. GPS is not a synonyme for general location services.
c
Ah, ok, now I understand what you’re saying…. no.. mac doesnt have GPS, but it does have location services which is all i am looking to access. Sorry, im not a Mac developer, im primarily iOS and Android, and assumed wrong about the macs having parity with these features when accessing location services. It’s opaque on the API side about what is being accessed to generate a geo-coordinate, and honestly, matter zero for my use case.
199 Views