Skip to content

Instantly share code, notes, and snippets.

@muchbeer
Last active January 5, 2022 15:45
Show Gist options
  • Select an option

  • Save muchbeer/49fc57cc4fe1fa609e23a5697b9c300b to your computer and use it in GitHub Desktop.

Select an option

Save muchbeer/49fc57cc4fe1fa609e23a5697b9c300b to your computer and use it in GitHub Desktop.

Revisions

  1. muchbeer revised this gist Jan 5, 2022. 1 changed file with 20 additions and 0 deletions.
    20 changes: 20 additions & 0 deletions apiKeyIgnore.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ***********************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>

  2. muchbeer created this gist Jan 5, 2022.
    3 changes: 3 additions & 0 deletions Constant.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    object Constants {
    const val UNSPLASH_IMAGE_TABLE = "unsplash_image_table
    }