Defining the main application service

As you already know, our application is dealing with Notes and Todos. The current application implementation keeps our data locally stored in the SQLite database. This data will be synchronized with the backend instance running on some remote server. All operations related to the synchronization will be performed silently in the background of our application. All responsibility will be given to the service, which we will define now. Create a new package called service and a new class MainService that will extend the Android service class. Make sure your implementation looks like this:

 class MainService : Service(), DataSynchronization { private val tag = "Main service" private var binder = getServiceBinder() ...

Get Mastering Android Development with Kotlin 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.