Last active
January 5, 2022 15:45
-
-
Save muchbeer/49fc57cc4fe1fa609e23a5697b9c300b to your computer and use it in GitHub Desktop.
Utility contained different useful component i.e Constant, declare apiKey and ignore using gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ***********************gitignore file******************* | |
| // add the below line | |
| /gradle.properties | |
| ************gradle.properties********************** | |
| API_KEY="" | |
| **************gradle.build********************* | |
| defaultConfig { | |
| buildConfigField("String", "API_KEY", API_KEY) | |
| } | |
| *****************Retrofit Interface***************** | |
| @Headers("Authorization: Client-ID ${BuildConfig.API_KEY}") | |
| @GET("/photos") | |
| suspend fun getAllUsers ( | |
| @Query("page") page : Int, | |
| @Query("per_page") per_page : Int | |
| ) : List<Users> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object Constants { | |
| const val UNSPLASH_IMAGE_TABLE = "unsplash_image_table | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment