In addition, when connecting to a remote service. specify the name of the application package in which the service is running.
in this way
Intent serviceIntent = new intent ("com.android.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage ("com.android.vending"); bindService (serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
Attention. To make sure your application is secure, always use explicit intent when starting a service and do not declare intent filters for your services. Using an implicit intent to start a service is a security risk because you cannot be sure that the service will respond to the intent and the user cannot see which service is starting. Starting with Android 5.0 (API level 21), the system throws an exception if you call bindService () with an implicit intent.
source share