Posts

Showing posts from January, 2021

Hide and Keep your API key out of GitHub repository

Image
  Secure your API key     When you upload your Android app on GitHub, you need to hide it as no one has access to it except   you. It is considered a security glitch, so that’s why it is important to hide your API key. I am going to show you how you can do that easily. Some Developers store their API key in a String variable like this. private static final String APK_KEY = "asjsdakf4d3ggs2ytm4x";   It is not good to push your secret th i ngs into public repository as other people could use up your limited API calls. That’s probably the least concerning situation. Sharing of API keys becomes more of a concern if the API key authenticates someone for access to a subset of data. So, let’s see how we can do that.   1. Create a file called gradle.properties in .gradle folder. - Drive C - Users folder - your user folder - .gradle folder Create it here - gradle.properties     Then, write your APPNAME_API_KEY = "asjsdakf4d3gg...