

We can see that local.properties file is excluded in the version control system. So, if we take a look at our gitignore files in general, we have: *.iml

So local.properties is a file that is generated by Android Studio and it is recommended not to include this in the version control system. # For customization when using a Version Control System, please read the # as it contains information specific to your local configuration. # This file should *NOT* be checked into Version Control Systems,

# Do not modify this file - YOUR CHANGES WILL BE ERASED! Welcome to our MindOrks blog on Using local.properties file to avoid API Keys check-in into Version Control System.Įvery time, we create a new project in Android Studio, we see a file created with the name “local.properties” containing the following content: # This file is automatically generated by Android Studio. Now, when we make our code available as public repositories, we should ensure we take care of some things such as the sharing of private API keys, restricted URLs, etc., How can we achieve this by using the “local.properties” file in our root project? Let’s find out in this article. Thanks to code hosting platforms like GitHub! gitignore files (and the default ones created by Android Studio inside the app folder and into other folders you could have) you will likely save only the necessary source code to your repository and not files which could be generated by Android Studio itself.One of the best benefits of being an Android Developer is that we can create and contribute to open source projects! We can share our code with millions of developers around the globe. gitignore file in the AndroidShowcase folder. # Local configuration file (sdk path, etc)Īnd the following as content for the. gitignore file in the AndroidShowcaseRepository folder # Built application files

So, for example, this is a sample structure ( folders are bolded): Usually, I create my project inside a parent folder which I initialize as my Git repository. gitignore file is sometimes tedious, so I have gathered some information on the Internet, mainly on StackOverflow, I made some experiments with my sample project over and over and finally I obtained a perfect Android Studio.
