Technical requirements

To run the code in this chapter, you will need to integrate the coroutines-core library. To do this, you should add the following line to the repositories block of the build.gradle file:

jcenter()

You should also add the following line to the dependencies block:

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.2'

Add the following line to integrate the kotlinx-coroutines-android library:

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.30.2'

If you are using a Kotlin version lower than 1.3, you should also add the following lines to the build.gradle file:

kotlin {
experimental {
coroutines "enable"
}
}

To integrate Spring for the Android library, you should add the following lines:

implementation 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.6'

You should also add the repositories block, as follows:

repositories {
maven {
url 'https://repo.spring.io/libs-milestone'
}
}

This chapter will also work with the JSON to Kotlin Class plugin. To install this plugin, open the Preferences window and select the Plugins section.

Press the Install button and restart Android Studio.

The source code for this chapter, with examples, is available on GitHub, at the following link: https://github.com/PacktPublishing/Learn-Spring-for-Android-Application-Development/tree/master/Chapter07.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.71.211