Setting up Anko

Anko has a Gradle-based project that can be plugged in by adding a single line inside app level build.gradle. This dependency will load all Anko features and functions into the app:

    dependencies {      compile fileTree(include: ['*.jar'], dir: 'libs')      androidTestCompile('com.android.support.test.espresso:espresso-        core:2.2.2', {        exclude group: 'com.android.support', module: 'support-          annotations'      })      compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"      compile "org.jetbrains.anko:anko:$anko_version"      // Other libs and gradle dependencies      testCompile 'junit:junit:4.12'    }

There are also a number of artifacts for the Android support libraries. Find more at https://github.com/Kotlin/anko:

    dependencies {      // Appcompat-v7 ...

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.