Android Reference App
Last updated
Last updated
This section guides you through the process of building and integrating the Android SDK into the application. The application demonstrates the use case of a merchant application where Mastercard Checkout Sound and Animation is played by default on a transaction approval using a Mastercard card. The application is a stand-alone project that does not require any backend to perform end-to-end testing and it also provides details on how the code can be changed to demonstrate all three features of Mastercard Sonic Branding.
Kotlinopens in a new tab version 1.8.20 to build
Gradleopens in a new tab version 8.2.1 to build
Reference Application for Android SDK can be downloaded below:
A development environment set up with your IDE of choice, preferred is Android Studio | Flamingo 2022.2.1opens in a new tab
Android SDK version Lollipop and above
A simple Android application that shows how Mastercard Checkout Sound and Animation is integrated into the merchant application.
A merchant application that shows how Mastercard Checkout Sound and Animation is played on a transaction approval.
When to integrate Mastercard Checkout Sound and Animation
Integration of Android SDK can be done in a fragment where confirmation of checkout is handled. In reference application, refer code in ConfirmOrderFragment
fragment which initializes the SonicController
.
What changes are required to play different features of Mastercard Sonic Branding
After the integration of Android SDK is completed, prepare the SonicController
with SonicType
at the creation of the confirmation view. Your controller is now prepared with the assets which are required to play the Checkout Sound and/or Animation. In reference application, refer in prepareSonicAnimation
method of ConfirmOrderFragment
fragment where you can provide a value of SonicType
and can check different behaviours of Mastercard Sonic Brand.
When to play Mastercard Checkout Sound and Animation
After the integration of Android SDK is completed and resources are prepared, wait for the transaction approval event. As soon as the transaction is approved, validate the Payment Network of Card account holder. For Mastercard, the Checkout Sound and/or Animation is played. In reference application, refer code in paymentSuccess
method of ConfirmOrderFragment
fragment which plays the Checkout Sound and/or Animation.