org.solovyev.android:billing-test

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

GroupId

GroupId

org.solovyev.android
ArtifactId

ArtifactId

billing-test
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

pom
Description

Description

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

Download billing-test

Filename Size
billing-test-1.0.1.pom 2 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/org.solovyev.android/billing-test/ -->
<dependency>
    <groupId>org.solovyev.android</groupId>
    <artifactId>billing-test</artifactId>
    <version>1.0.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.solovyev.android/billing-test/
implementation 'org.solovyev.android:billing-test:1.0.1'
// https://jarcasting.com/artifacts/org.solovyev.android/billing-test/
implementation ("org.solovyev.android:billing-test:1.0.1")
'org.solovyev.android:billing-test:pom:1.0.1'
<dependency org="org.solovyev.android" name="billing-test" rev="1.0.1">
  <artifact name="billing-test" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.solovyev.android', module='billing-test', version='1.0.1')
)
libraryDependencies += "org.solovyev.android" % "billing-test" % "1.0.1"
[org.solovyev.android/billing-test "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Android Billing Library

requestPurchase("com.example.item")

That's how simple it should be to use Android In-app Billing.

And with this library it is.

(or will be; this is a very early release)

Android Billing Library implements in-app billing's full specification and offers high-level classes to use it. Transactions are stored in a local obfuscated database which can be easily queried.

Getting Started

  • Add this library to your project.

  • Open the AndroidManifest.xml of your application and add this permission...

<uses-permission android:name="com.android.vending.BILLING" />

...and this service and receiver inside the application element:

<service android:name="net.robotmedia.billing.BillingService" />
<receiver android:name="net.robotmedia.billing.BillingReceiver">
	<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>
</receiver>

That's it!

Usage

Subclassing AbstractBillingActivity

AbstractBillingActivity is an abstract activity that provides default integration with in-app billing. It is useful to get acquainted with the library, or for very simple applications that require in-app billing integration in only one activity. For more flexibility use BillingController instead.

When created your AbstractBillingActivity instance will check if in-app billing is supported, followed by a call to onBillingChecked(boolean), which has to be implemented by the subclass.

Additionally, your AbstractBillingActivity subclass will attempt to restore all transactions, only once. This is necessary in case the user has previously installed the app and made purchases. Existing transactions will generate calls to onPurchaseStateChange(String, PurchaseState), which has to be implemented by the subclass.

Starting a purchase is as simple as calling requestPurchase(String). AbstractBillingActivity will start the Android Market intent automatically and onPurchaseStateChange(String, PurchaseState) will be called after the transaction is confirmed.

If you override any of the methods provided by AbstractBillingActivity, make sure to call the superclass implementation.

BillingController

BillingController provides high-level functions to interact with the Billing service and to query an obfuscated local transaction database.

Since most billing functions are asynchronous, BillingController notifies all registered IBillingObserver of the responses.

Additionally, BillingController requires a BillingController.IConfiguration instance from which the public key required to validate signed messages and a salt to obfuscate transactions are obtained. A good place to provide the configuration is in the Application subclass.

Dungeons Redux

Dungeons Redux is a sample app that shows how to use Android Billing Library through BillingController. It is a simplified version of the Dungeons in-app billing example provided by Google.

It should be noted that Dungeons Redux does not intend to be an example of how to use in-app billing in general.

Disclaimer

This library is a very early release and it should not be used as production code.

Contact

http://www.twitter.com/robot_media | http://www.facebook.com/robotmedia | http://www.robotmedia.net

License

Copyright 2011 Robot Media SL (http://www.robotmedia.net)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
1.0.1