Add it to your root build.gradle at the end of repositories:
allprojects {
repositories {
//...
maven { url 'https://jitpack.io' }
}
}
Add the dependency to app level build.gradle
dependencies {
implementation 'com.github.mikroafrica:topwise-big:2.0.3'
}
<aside> 💡 Similarly, you can add dependencies for other devices see Dependencies
</aside>
Internet permission is required to use this library. Add internet permission to your app AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
Depending on whether you override the Application class, perform one of the following:
If you do not override the Application class, edit your manifest file to set android:name in the <application> tag as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application
android:name="com.example.App">
...
</application>
</manifest>
// If its a TopwiseT1 device
Add the PinpadActivity to your android manifest
<activity android:name="com.topwise.emv.PinpadActivity" />
If you do override the Application class, change it to extend MyApplication as follows:
import com.posdevice.TransactionHandler
public class App extends MyApplication {...}
The posDevice is responsible for card reading and performing the transaction.