package com.nestedworld.nestedworld.helpers.service;

import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.support.annotation.NonNull;

import com.nestedworld.nestedworld.data.network.socket.service.SocketService;

public final class ServiceHelper {
    /*
     * #############################################################################################
     * # Constructor
     * #############################################################################################
     */
    private ServiceHelper() {
        //Empty constructor for avoiding this class to be construct
    }

    /*
     * #############################################################################################
     * # Public (static) method
     * #############################################################################################
     */
    public static void startSocketService(@NonNull final Context context) {
        //Start the service
        final Intent intent = new Intent(context, SocketService.class);
        context.startService(intent);
    }

    public static void stopSocketService(@NonNull final Context context) {
        //Start the service
        final Intent intent = new Intent(context, SocketService.class);
        context.stopService(intent);
    }

    public static void bindToSocketService(@NonNull final Context context,
                                           @NonNull final ServiceConnection serviceConnection) {
        context.bindService(new Intent(context, SocketService.class), serviceConnection, Context.BIND_AUTO_CREATE);
    }

    public static void unbindFromSocketService(@NonNull final Context context,
                                               @NonNull final ServiceConnection serviceConnection) {
        context.unbindService(serviceConnection);
    }
}

@@ -278,43 +278,177 @@
 ce;%0A
-%0Apublic final class ServiceHelper %7B
+import com.nestedworld.nestedworld.helpers.log.LogHelper;%0A%0Apublic final class ServiceHelper %7B%0A    private final static String TAG = ServiceHelper.class.getSimpleName();%0A
 %0A   
@@ -1104,32 +1104,81 @@
 text context) %7B%0A
+        LogHelper.d(TAG, %22startSocketService%22);%0A%0A
         //Start 
@@ -1373,32 +1373,80 @@
 text context) %7B%0A
+        LogHelper.d(TAG, %22stopSocketService%22);%0A%0A
         //Start 
@@ -1737,32 +1737,82 @@
 ceConnection) %7B%0A
+        LogHelper.d(TAG, %22bindToSocketService%22);%0A%0A
         context.
@@ -2090,32 +2090,82 @@
 ceConnection) %7B%0A
+        LogHelper.d(TAG, %22bindToSocketService%22);%0A%0A
         context.

enhance serviceHelper