This is a library that contains utilities which are useful when developing Android SDKs. They are intended for use internally by Rakuten's SDKs.
Add to your build.gradle
:
repositories {
jcenter()
}
dependency {
implementation 'com.rakuten.tech.mobile.sdkutils:sdk-utils:0.1.0'
}
This library contains an extension function for OkHttpClient.Builder
so you can more easily add headers to all network requests which are made using that client.
private val client = OkHttpClient.Builder()
.addHeaderInterceptor(
"header_name" to "header_value",
"another_header" to "another_value"
).build()
The AppInfo
class can be used to retrieve some properties of the App which normally require a Context
to retrieve. This class is automatically initialized, so no Context
needs to be provided.
val appName = AppInfo.instance.name
val appVersion = AppInfo.instance.version
- Initial release.