...
Version | Date | Changes | Author |
---|---|---|---|
1.1 | 20 December 2024 | Added Sample of Demo | Julien Garnier |
1.0 | 28 October 2024 | Initial Documentation | Julien Garnier |
...
SUNMI POS Model number is P1N or P1-4G or P2PRO or P2 Lite SE (Check Settings-->About-->Model number)
SUNMI PayHardware Service (SPHS) SDK. Version 3.3.0 or the latest version. SunmiPayHardwareService_v3.3.0_release.apk
Go to Settings in the Device → Then search in the bar “SunmiPayHardwareService” → Click on it → Click on the Advanced button → In the advanced section, check the version of the SPHS SDK.
Android Studio Quick integrate, Put the PayLib-release-xxx.aar package under the libs folders of your App.
View file name paylib-2.0.14.aar.zip Code Block repositoriesdependencies { flatDir { dirs 'libs' } } dependencies { ...... compile(name: 'PayLib-release-xxx', ext: 'aar'implementation(files("libs/paylib-2.0.14.aar")) }
Note |
---|
Warning
|
...
Method to disable Navigation Bar
...
Example Code
Extract of the Navigation Bar to Activate or Deactivate in Kotlin.
Here attached you will find the complete sample.
View file | ||
---|---|---|
|
Code Block | ||
---|---|---|
| ||
object SunmiSdkIntegrationExample { private val instance: SunmiPayKernel = SunmiPayKernel.getInstance() private var isInitialized: Boolean = false /** * Initialize Sunmi SDK before calling it */ suspend fun init(context: Context): Boolean { if (isInitialized) { return true } isInitialized = suspendCoroutine { SunmiPayKernel.getInstance().initPaySDK( context, object : SunmiPayKernel.ConnectCallback { override fun onConnectPaySDK() { it.resume(true) } override fun onDisconnectPaySDK() { it.resume(false) } } ) } return isInitialized } /** * Change navigation bar visibility according a flag */ fun setNavigationBarVisibility(enabled: Boolean) { if (enabled) { instance.mBasicOptV2.setNavigationBarVisibility(AidlConstants.SystemUI.SHOW_NAV_BAR) } else { instance.mBasicOptV2.setNavigationBarVisibility(AidlConstants.SystemUI.HIDE_NAV_BAR) } } } |
...