AndroidBillingLibrary


Source link: https://github.com/robotmedia/AndroidBillingLibrary

Update

In-app Billing v2 API is deprecated and will be shut down in January 2015. This library was developed for v2 a long time ago. If your app is still using this library, please migrate to the v3 API as soon as possible.

The project Android Checkout Library by @serso supports v3 and attemps to provide data compatibility with AndroidBillingLibrary. We haven't verified this so please use it at your own discretion.

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.

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

  • Get acquainted with the Android In-app Billing documentation.

  • Add Android Billing 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 (an analogous class for fragments is also provided). 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 directly.

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 Google Play 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 via 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.

Contact

http://www.twitter.com/robotmedia | 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.

Resources

This library is to take picture using camera from background without displaying preview.

A sample application that can be used as a template for implementing Mobile Two Factor Auth

The major drawback of authentication performed including something that the user possesses is that the physical token (the USB stick, the bank card, the key or similar) must be carried around by the user, practically at all times. Loss and theft are a risk. There are also costs involved in procuring and subsequently replacing tokens of this kind. In addition, there are inherent conflicts and unavoidable trade-offs between usability and security.

It is a library with several commonly used Input Dialogs implementations.

A Mac App, for Apk multi-channel package.

A playground for MVVM style architecture on Android.

gifencoder is a pure Java library implementing the GIF89a specification.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes