The Android Example App demonstrates the basic usage of UI components.
It includes examples of initializing UI components with various configurations.
With this app, you can carry out tokenization, refund, and charge requests.
All code samples are found in the MainActivity
class.
Ensure to replace the placeholder authorization data with your own to successfully perform the requests.
Authorization authorization = Authorization
.fromKeys("staging", "pk_XXXXXXXXXXXXXXXXXXXXXXXXXX", "MRT_XXXXXXXXXXXXXXXXXXXXXXXXXX");
You can also modify the field configuration yourself and initialize UI Components with this data.
FieldOptions option = new FieldOptions(
new FieldConfiguration(DisplayConfiguration.REQUIRED),
new FieldConfiguration(DisplayConfiguration.REQUIRED)
);
Once you have completed the setup, select 'demo' under the Run/Debug Configuration and then run the project.
Your development environment must have minimum requirements configured:
Requirements
- Java 8 is installed and available in your
PATH
- Android Studio
- Gradle 5.4.1+
- Android SDK >= 21
Note: If you do have the Android SDK installed, add a local.properties
file to the top level directory with sdk.dir=/path/to/your/sdk/.android-sdk