A video of the presentation (in Greek) is also available.
An introduction to Kotlin Coroutines for Android
A video of the presentation (in Greek) is also available.
You can find info on what the SMS Retriever API is here. Chances are that reaching this page means you already know that. For some reasons the hash generation process described in the docs did not work for me. Probably it’s a Mac only issue or the implementation of the sha256sum function I installed with coreutils.
What worked for me is getting the hash from within the App. A helper class for this is provided in Google Samples project.
A Kotlin snippet that does the same can be found bellow.
fun getAppSignature(context: Context) = context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_SIGNATURES)
.signatures.mapNotNull { hash(context.packageName, it.toCharsString()) }.firstOrNull()
private fun hash(packageName: String, signature: String) = try {
val messageDigest = MessageDigest.getInstance("SHA-256")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
messageDigest.update("$packageName $signature".toByteArray(StandardCharsets.UTF_8))
}
var hashSignature = messageDigest.digest()
hashSignature = Arrays.copyOfRange(hashSignature, 0, 9)
var base64Hash = Base64.encodeToString(hashSignature, Base64.NO_PADDING or Base64.NO_WRAP)
base64Hash = base64Hash.substring(0, 11)
base64Hash
} catch (e: NoSuchAlgorithmException) {
null
}
I few days ago I gave a talk at Voxxed Days Athens titled “Why Kotlin?”
The first part is an introduction to the language (and might be boring for someone already into the language). In the second part I tried to provide some arguments on why Kotlin is here to stay.
My TOP-10 on Why Kotlin is the following:
You can watch the full presentation above. The slides are also available at SpeakerDeck.
[Direct YouTube link]