Skip to content

SanjayDevTech/IconFinderAndroid

Repository files navigation

Icon Finder Android App

IconFinder

IconFinder docs

Tech

  • Jetpack Compose
  • Hilt
  • Retrofit

Setup

  • Get an api key from IconFinder
  • Create a secrets.properties file in the root of the project
  • Paste the API key as API_KEY=<api_key>
  • Add the below function in app/build.gradle file
static def getApiKey(){
    def props = new Properties()
    try {
        props.load(new FileInputStream(new File('secrets.properties')))
        return props['API_KEY']
    } catch(ignored) {
        return ""
    }
}
  • Add the API Key in build configuration
android {
    //...
    buildTypes {
        debug {
            // for debug
            buildConfigField "String", "API_KEY", "\"${getApiKey()}\""
        }
        release {
            // for release
            buildConfigField "String", "API_KEY", "\"${getApiKey()}\""
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
  • Sync, Build & run!!! :)