Hello all, I'm trying to use the service, but when start it returns this error:
the name of my service is AcquistiInApp, I' have the google key and the app is registered on google, I have put this on manifest:
and this is the service code:
B4X:
acquistiinapp_service_create (java line: 180)
java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.android.vending.billing.MarketBillingService.BIND }
at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1357)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1466)
at android.app.ContextImpl.bindService(ContextImpl.java:1434)
at android.content.ContextWrapper.bindService(ContextWrapper.java:636)
at com.android.vending.billing.BillingGate.bindToMarketBillingService(BillingGate.java:380)
at com.android.vending.billing.BillingGate.access$0(BillingGate.java:375)
at com.android.vending.billing.BillingGate$BillingRequest.runRequest(BillingGate.java:103)
at com.android.vending.billing.BillingGate.checkBillingSupported(BillingGate.java:401)
at anywheresoftware.b4a.inappbilling.BillingManager.Initialize(BillingManager.java:49)
at com.OlaLove.acquistiinapp._service_create(acquistiinapp.java:180)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at com.OlaLove.acquistiinapp.onCreate(acquistiinapp.java:56)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3253)
at android.app.ActivityThread.-wrap5(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1617)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
B4X:
AddReceiverText(AcquistiInApp, <intent-filter>
<action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
<action android:name="com.android.vending.billing.RESPONSE_CODE" />
<action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
</intent-filter>)
and this is the service code:
B4X:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
Dim Manager As BillingManager
Dim PublicKey As String
PublicKey = "here my google key…." 'From the developer console
End Sub
Sub Service_Create
Manager.Initialize("manager", PublicKey)
End Sub
Sub Service_Start (StartingIntent As Intent)
Manager.HandleIntent(StartingIntent)
End Sub
Sub Manager_BillingSupported (Supported As Boolean)
Log("BillingSupported: " & Supported)
End Sub
Sub Manager_PurchaseStateChange (PurchaseState As Int, ProductId As String, OrderId As String, PurchaseTime As Long, ExtraData As String)
Log("PurchaseStateChange: " & PurchaseState & ", " & ProductId& ", " & OrderId & ", " & DateTime.Time(PurchaseTime) & ", " & ExtraData)
If PurchaseState = Manager.PURCHASE_STATE_PURCHASED Then
'Here you should store the purchase information
'and then notify the activity about the purchase.
'In most cases the activity will be running at this state. However it is possible that it will be paused.
'In that case the following call will be ignored.
'CallSub2(Main, "ThankYouForPurchasing", ProductId)
End If
End Sub
Sub Service_Destroy
Manager.UnbindMarketService
End Sub