class TrackingService extends Service {

    public static void startAndBindService(Context context, Class<?> cls, ServiceConnection connection, TrackingServiceOptions options) {
        Intent mIntent = TrackingService.getIntent(context, cls, options);
        TrackingService.bindService(context, mIntent, connection);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            context.startForegroundService(mIntent);
        } else {
            context.startService(mIntent);
        }
    }

}