-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace proprietary Google Fused location library with open source microG library #901
Comments
How is that possible? If the server-side is also open source, it's not Google's, it's an alternative service, right? |
Yes. And there is a local database as well, which records WiFi and Cell when GPS works and use it to determine location later. |
So, we can't replace it or users expecting Google's accuracy won't have it anymore? Additionally I don't plan on bundling a 2 GB local database, requesting additional permissions nearby wifi and bluetooth and more, it's overkill. |
With open source network service, the accuracy is worse than Google's. With local database, it could be much better than Google's where you have reached.
No. There is no additional database when build. microG just collect data and build database on user's devices locally when they use the device. And Breezy Weather needn't any additional permission: Breezy Weather request location from microG application installed on the same device. microG will do all the thing, Breezy Weather just need call a API. |
So, that's a completely different location provider? It needs a separate entry in Settings > Location > Location service, then. If the user needs to install microG Services, it's the same thing as if they need to install Google Play Services. It won't work on devices without it. I will leave this open to contributions. |
Yes.
There is a problem: it uses the same API as GMS. From the caller side, the application calls microG the same way as it calls GMS. In fact, if you set the source to GMS Fused Location and install microG, it will work just like GMS was installed. So separate entry is impossible and useless. In my opinion, I want to push this source into Standard and F-Droid flavors. Because this source can be used without proprietary Google GMS service or library, it should be included in Standard flavor. Because microG's Fused Location implementation uses all libre services and code, it should be included in F-Droid flavor.
|
PS: microG and GMS are both service and library, and they can be combined in any combination:
|
That's much clearer now, thanks!
But there are also users like me without any *Services that must still be able to use the current location without it failing. So, at the moment, the idea is to replace the library of the To use it in I also don't think we can really qualify the Google Fused location as a "free network" because someone reversed engineered, spoofed Google signature and re-used the same API. It's still a non-free network in the way it was intended and for the majority of users who have Google Play Services and not microG. So adding it to |
microG is designed to have the same behavior as GMS except non-privacy behaviors. There are few documents about microG for developers because it's the same as GMS in most cases. If you have any questions, @mar-v-in and @ale5000-git may give you some answers. And @relan has some experience using microG to replace GMS in Fennec (A full free Firefox build).
Ok, at least this source will have a place in Standard flavor. For the non-free network, @linsui from F-droid may have some opinions. |
In F-Droid flavor as long as the fused location is not used by default it's not considered as NonFreeNet. |
WIP on https://github.com/breezy-weather/breezy-weather/tree/microg branch as a separate location source you can select from I don't have Google Play Services or microG so feel free to test |
I can confirm that the Fused Location works well with microG 0.3.1. Tested-by: Coelacanthus CoelacanthusHex@gmail.com |
@Cryolitia and @KunoiSayami confirmed it works with GMS. |
Confirmed it works with GMS on Sony Xperia 1 IV, firmware version 64.2.A.2.112. Tested-by: Cryolitia Cryolitia@gmail.com |
Currently, the Google Fused Location uses both Fused + Android framework in parallel, so if Fused fails, you still have data. So, I removed Android framework calls to keep only the efficient Fused. You can download the debug artifact from: https://github.com/breezy-weather/breezy-weather/pull/914/checks Please test it that way:
If it works, let me know! If it doesn't work, please export the crash log from Thanks! |
As far as I can tell, microg does not support the recommended way to get the current location (getCurrentLocation). See microg FusedLocationProviderClientImpl The app currently uses requestLocationUpdates, which is supported, but intended for tracking rather than locating. |
I think it's not a problem in current way: it only affect users use BW with microG service, it doesn't affect users use BW compiled with microG but with GMS service. Of course, it's better to let upstream support other methods. |
I can confirm it works well with microG 0.3.1. |
We have another important bug that makes it a no-go for now: see microg/GmsCore#2309 We will keep the Google Play lib on |
There is a 3rd option that I randomly found and is barely used in any other app (because Android framework documentation for location services is nearly inexistant): Fused provider is natively supported on Android >= 12 and Basically, this means we can decide to not depend on any library, and use the native Android functions, but this will only supports Android >= 12 (previous versions will just use the regular Android source, both network and GPS). Given all Android versions < 12 are EoL, I think it's an acceptable trade-off to get rid of a dependency and a flavor. WIP on |
This branch was tested on different phones successfully. This makes this request obsolete as we no longer depend on any library |
Describe your idea
Now fused location feature is only enabled in Google Play flavor. But it can be implemented with open source projects and services completely. To use this feature, we must include a library and a runtime application. Both of them can be implemented with OSS easily. For the former, just replace https://github.com/breezy-weather/breezy-weather/blob/main/app/build.gradle.kts#L217 with OSS implementation https://github.com/microg/GmsCore/tree/master/play-services-location, which is compatible with gms API by API but completely open source, even doesn't use non-free network service. Some open source projects in F-droid have started to use microG to implemented these useful feature in easy and open source way, such as Fennec, which uses microG to implement FIDO feature. For the latter, just use microG to replace Google's GMS.
Other details
No response
Acknowledgements
The text was updated successfully, but these errors were encountered: