Demo Android Classes
|AndroidInAppProduct||A product registered in the store.|
|AndroidInAppTransaction||Contains information about a transaction in the external app store.|
|AndroidInAppPurchaseBackend||Comminucates with external store.|
|Communication between Google Play's billing system and C++.|
Check out Base Classes
AndroidInAppProduct adds purchase() for initializing purchasing process.
AndroidInAppTransaction is created in the AndroidInAppPurchaseBackend using purchaseSucceeded(), purchaseFailed() and checkFinalizationStatus().
AndroidInAppTransaction adds new parameters and return types. Class has finalize() function that separates Consumable and Unlockable products to be either acknowledged or consumed in the InAppPurchase.java.
AndroidInAppPurchaseBackend makes and receives calls from InAppPurchase.java. This class is one of the back end components in the application.
Shows the products information on the store page.
- AndroidInAppPurchaseBackend is called from InAppStore::setupBackend().
- At initialization AndroidInAppPurchaseBackend will give Context and pointer of its self to the Java in the calls constructor and then initializes the connection to the Google Play store using the initialize() function.
- When the connection is successful, androidjni will call registerRedy() which emits the ready() signal to InAppStore and starts queryProducts() function to get the information of the purchasable items.
- When the query is done, productQueryDone() signal is emitted and the item's information will be visible on the application's store page.
When pressing one of the products on the applications store page a call is routed through
AndroidInAppProduct::purchase() to purchaseProduct() function. This then calls the Java method launchBillingFlow() which opens Goole Plays billing flow to the user.
InAppPurchase.java and androidjni.cpp
AndroidInAppPurchaseBackend makes calls directly to
InAppPurchase.java and receives Java calls from androidjni. The demo application communicates with Java function using QJniObject.
See also Integrate the Google Play Billing Library, QJniObject, and QJniEnvironment.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.