O'Reilly logo

Mastering Android Development with Kotlin by Miloš Vasić

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Defining the intent service

We have our main service running and responsibility defined. We will now make more improvements to our application by introducing one more service. This time, we will define the intent service. The intent service will take over the responsibility for the execution of the database CRUD operations. Basically, we will define our intent service and perform refactoring of the code we already have.

First, we will create a new class inside the service package called DatabaseService. Before we put the whole implementation, we will register it in the Android Manifest as follows:

    <manifest xmlns:android= "http://schemas.android.com/apk/res/android" package="com.journaler"> ... <application ... > <service android:name=".service.MainService" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required