I want to publish an Android App in Github. The problem is that I work with Google Maps Api, and I have the api key within the project.
What is you recommendation about that? Just erase the api key from the code?
Thanks!
You could erase the API key from the code but it would be a struggle to keep removing it from the code when pushing to the repository.
I would create a new value resource file called keys.xml and move all your API keys there. Then add keys.xml to the gitignore so it is never pushed. In the AndroidManifest you simply point to the string resource.
In your repository's README you could instruct developers how to add their own API keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With