Nodrex / Testomania

In practice more knowledge comes
https://play.google.com/store/apps/details?id=com.earth.testomania
Creative Commons Zero v1.0 Universal
49 stars 3 forks source link

Hide QuizApi key #392

Open Nodrex opened 1 year ago

Nodrex commented 1 year ago

Remove QuizApi key from kotlin file and move to an environment not to be visible in commits

Nodrex commented 1 year ago

Create a .env file in the root directory of your project. In the .env file, add the following line:

API_KEY=YOUR_API_KEY

When you are working locally, you can access your API key by using the following code:

String apiKey = System.getenv("API_KEY");

You can then use the API key in your Android code. For example, you can use it to make an API call.

Here is an example of how to use an API key to make an API call in Android:

service.getSomething(System.getenv("API_KEY"));