opendroneid / receiver-android

Example Android receiver application for unmanned aircraft Remote ID
Apache License 2.0
186 stars 61 forks source link

Changed the map used to OpenStreetMap #69

Closed ToshihiroMakuuchi closed 2 years ago

ToshihiroMakuuchi commented 2 years ago

GoogleMap requires the use of an API key; we thought that if we replaced it with OpenStreetMap, we could distribute it freely, so we replaced it with this sample. If you like, I thought it would be good if you could choose OpenStreetMap as one of the MapType options. Please consider it.

And thanks to the Japanese users who developed the sample code. https://twitter.com/_ganchi https://github.com/ganchi/receiver-android-jp

friissoren commented 2 years ago

This is a very nice idea and would be great to get merged in. However, it would be nice if we could find a way to have this included without having to comment out other parts of the code to get rid of the Google Maps stuff.

Obviously the two code parts can't be active at the same time but it would be nice if we could find a way to do the variation using a compile flag or similar. Unfortunately my Android skills are rather limited in that department. I tried to add a flag in gradle.properties, which at least was visible in build.gradle and allowed some variation there. That also allowed to create a flag that would be visible to the Java code.

However, I could not figure out how to variate the class variable in activity_debug.xml. I.e. it is still necessary to change code in two places in order to swap between the two map types.

https://github.com/opendroneid/receiver-android/commit/7ee553ae00c4dcb2f1654f167acd918d8022e851

I wonder if anyone following this project is wiser in the art of build variation for Android?

gabrielcox commented 2 years ago

@friissoren, if we add this, could we also commit apk distros to the repo?

friissoren commented 2 years ago

If we add this, could we also commit apk distros to the repo?

Yes, I think so, assuming the licensing conditions for Open Street Map are okay.

Probably we can't come up with any better code variation mechanism right now than just commenting out stuff in a few places. Maybe someone will later on figure out how to do that in a nicer way.

I would need to do some documentation updates and a bit of additional code clean-up before merging this. Hopefully I would have some time for that tomorrow. The Japan remote ID rule goes into effect on the 20th June. I can understand people are eager to get this moving forward.

ToshihiroMakuuchi commented 2 years ago

@friissoren ,

The build variants feature allows for branching at build time. However, I am not an Android application creator and do not have this technology. I look forward to the cooperation of users around the world.

Configure your build