I am trying to implement billing in an application in my application based on an example application . But bindService always returns false .
Here is what I have. AndroidManifest.xml
<service android:name="tv.app.billing.BillingService" />
Preferences.java (you need to start the purchase from the settings screen):
protected void onCreate(Bundle savedInstanceState) { mBillingService = new BillingService(); mBillingService.setContext(this);
BillingService.java : Public class BillingService extends Service implements ServiceConnection {
/** * Binds to the MarketBillingService and returns true if the bind * succeeded. * @return true if the bind succeeded; false otherwise */ private boolean bindToMarketBillingService() { try { if (Debug.DEBUG) { Log.i(TAG, "binding to Market billing service"); } boolean bindResult = bindService( new Intent(Consts.MARKET_BILLING_SERVICE_ACTION), this, // ServiceConnection. Context.BIND_AUTO_CREATE); if (bindResult) { return true; } else { Log.e(TAG, "Could not bind to service."); } } catch (SecurityException e) { Log.e(TAG, "Security exception: " + e); } return false; }
And in LogCat I see:
WARN/ActivityManager(48): Unable to start service Intent { act=com.android.vending.billing.MarketBillingService.BIND }: not found
What do I need to fix here?
source share