DynamixSoftware / PrintingSample

34 stars 23 forks source link

Unable to start service #7

Closed rahulbaboria closed 3 years ago

rahulbaboria commented 6 years ago
I'm starting service, but it not able to start service.

compile 'com.dynamixsoftware.intentapi:intentAPI:12'
compile 'com.dynamixsoftware.printingsdk:printingSDK:12'

   printingSdk = new PrintingSdk(this);
            printingSdk.startService(new IServiceCallback() {
                @Override
                public void onServiceConnected() {
                    Logr.d("Print service connected ");
                    continueToConnection();
                }

                @Override
                public void onServiceDisconnected() {
                    Logr.d("Print service disconnected ");

                }
            });

I tried debugging and got that it is returning false in every context.bindService

public void startService(IServiceCallback serviceCallback) {
        this.serviceCallback = serviceCallback;

        Intent intent = new Intent(ACTION_PRINTER_LAUCNH_SERVICE);
        intent.setClassName("com.dynamixsoftware.printhand", "com.dynamixsoftware.printservice.PrintingService");
        intent.setPackage("com.dynamixsoftware.printhand");

        boolean result = context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
        if (!result) {
            intent.setClassName("com.dynamixsoftware.printhand.premium", "com.dynamixsoftware.printservice.PrintingService");
            intent.setPackage("com.dynamixsoftware.printhand.premium");
            context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
        }
        result = context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
        if (!result) {
            intent.setClassName("com.dynamixsoftware.printhand.service", "com.dynamixsoftware.printservice.PrintingService");
            intent.setPackage("com.dynamixsoftware.printhand.service");
            context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
        }
    }
DynamixSoftware commented 6 years ago

Hello,

may I ask you to send us the logs or a bug report? Also, do you have the PrintHand app installed on the device?

Have a nice day, Konstantin

On Tue, Oct 23, 2018 at 11:47 AM, Rahul Baboria notifications@github.com wrote:

I'm starting service, but it not able to start service.

compile 'com.dynamixsoftware.intentapi:intentAPI:12' compile 'com.dynamixsoftware.printingsdk:printingSDK:12'

printingSdk = new PrintingSdk(this); printingSdk.startService(new IServiceCallback() { @Override public void onServiceConnected() { Logr.d("Print service connected "); continueToConnection(); }

            @Override
            public void onServiceDisconnected() {
                Logr.d("Print service disconnected ");

            }
        });

I tried debugging and got that it is showing false everytime

public void startService(IServiceCallback serviceCallback) { this.serviceCallback = serviceCallback;

  Intent intent = new Intent(ACTION_PRINTER_LAUCNH_SERVICE);
  intent.setClassName("com.dynamixsoftware.printhand", "com.dynamixsoftware.printservice.PrintingService");
  intent.setPackage("com.dynamixsoftware.printhand");

  boolean result = context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
  if (!result) {
      intent.setClassName("com.dynamixsoftware.printhand.premium", "com.dynamixsoftware.printservice.PrintingService");
      intent.setPackage("com.dynamixsoftware.printhand.premium");
      context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
  }
  result = context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
  if (!result) {
      intent.setClassName("com.dynamixsoftware.printhand.service", "com.dynamixsoftware.printservice.PrintingService");
      intent.setPackage("com.dynamixsoftware.printhand.service");
      context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
  }

}

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DynamixSoftware/PrintingSample/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AOR7FdS8CCmnDcrq7M2dLF_cib_IL0i8ks5unruAgaJpZM4X00YX .

-- Tech support