59.4 Adding a Bound Service to the Project
To add a new class to the project, right-click on the package name (located under app -> java -> com.ebookfrenzy.localbound) within the Project tool window and select the New -> Service -> Service menu option. Specify BoundService as the class name and make sure that both the Exported and Enabled options are selected before clicking on Finish to create the class. Android Studio will load the BoundService.java file into the editor where it will read as follows:
package com.ebookfrenzy.localbound;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class BoundService extends Service {
public BoundService() {
}
@Override
public IBinder onBind(Intent intent) {
// TODO: Return the communication...