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
val file = File(context.filesDir, "config.json") | |
val encoded = FileUtils.readFileToString(file) | |
val configurationObj = gson.fromJson(encoded, FooConfiguration::class.java) |
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
val file = File(context.filesDir, "config.json") | |
val encoded = gson.toJson(configurationObj) | |
FileUtils.writeStringToFile(file, encoded) |
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
implementation 'com.google.code.gson:gson:2.8.5' | |
implementation 'org.apache.commons:commons-io:1.3.2' |
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
proguardFiles getDefaultProguardFile('proguard-android.txt') | |
file('proguard').listFiles().each { proguardFile it } |
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
android { | |
... | |
defaultConfig { | |
... | |
buildConfigField "String", "BUILD_TIME", "\"${buildTime()}\"" | |
} | |
} | |
def buildTime() { | |
def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'") |