And one more clarification.
IMarketBillingService is not the billing service's class name, hence,
the service can't be started or bound by using that class. It's the name
of an interface that this service exposes, and only comes into play
after the service has been bound.
However, this is irrelevant, because the code quoted by Gustavo from the
billing reference, as well as code in the dungeons & potions sample,
both use an implicit intent with an action string.
Besides, the code for binding to the billing service here is wrong:
http://developer.android.com/guide/market/billing/billing_integrate.html#billing-service
The difference between wrong (online docs) and working (sample sources)
intents is the action's value.
Online docs use the class name, "com.android.....IMarketBillingService",
as the action string, whereas the correct code uses a different
constant, which has the value "com.android...BIND".
The latter works for me with Market 2.3.4, the former does not, exactly
the same way (bindService returns false).
I hope they straighten it out before officially launching the service.
-- Kostya
24.03.2011 20:05, Justin Anderson пишет:
/> Probably that class is not in your application so an "explicit" intent
(with a class name) is not going to work./
That is not necessarily true... Explicit intents work even if the
class is not in your application as long as you specify both the
package name and the class name.
I use this methodology for my task switching app, AppSwipe!, which is
available for free on the Android Market.
Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware
On Thu, Mar 24, 2011 at 10:57 AM, Kostya Vasilyev <kmans...@gmail.com
<mailto:kmans...@gmail.com>> wrote:
There is that, but also - IMarketBillingService is not the billing
service class. It's the interface exposed by this service through
binding.
Gustavo - see dungeons & potions sample code here:
http://developer.android.com/guide/market/billing/billing_integrate.html#billing-download
The correct code for binding to Market billing service is in
BillingService.java, see method bindToMarketBillingService().
PS - I believe you copied your code from the online documentation.
Looks wrong to me.
-- Kostya
24.03.2011 18 <tel:24.03.2011%2018>:49, jotobjects пишет:
Probably that class is not in your application so an
"explicit" intent
(with a class name) is not going to work.
On Mar 24, 4:04 am, Gustavo Costa<guga...@gmail.com
<mailto:guga...@gmail.com>> wrote:
I'm trying start
com.android.vending.billing.IMarketBillingService service
and I received this message. I'm using emulator Android
2.3.3 - API Level
10. Anybody help me?
03-23 15:04:53.535: WARN/ActivityManager(61): Unable to
start service Intent {
act=com.android.vending.billing.IMarketBillingService }:
not found
03-23 15:04:53.535: ERROR/BillingService(416): Could not
bind to service.
Code:
private boolean bindToMarketBillingService() {
try {
if (Consts.DEBUG) {
Log.i(TAG, "binding to Market billing service");
}
boolean bindResult = bindService(
new
Intent(IMarketBillingService.class.getName()),
this,
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;
}
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
android-developers@googlegroups.com
<mailto:android-developers@googlegroups.com>
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
<mailto:android-developers%2bunsubscr...@googlegroups.com>
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en