Android SDK Proxy

SDK connect is a service that allows you to connect your app remotely to the SDK using bluetooth , WiFi.

Initialize

  1. Add gradle dependency by adding the following code to the your Android App build.gradle
dependencies {
    implementation 'io.nearpay:nearpay-proxy:0.0.21'
}
  1. Create single instance of NearPay object with context wherever you need.
val nearpay = NearPay(this, AuthenticationData.UserEnter, Locale.getDefault(), Environments.SANDBOX)
  1. Create nearpay connect object and add NearPay object to it
val nearpayProxy = NearpayProxy.getInstanceOrCreate(
context = context,
nearPay = nearPay,
port = 8080,
object : connectionStatusListener {
    override fun onPaired() {
            //Your Code here...
    }
    
    override fun onConnected() {
        //Your Code here...
    }
    
    override fun onDisconnected() {
        //Your Code here...
    }

    override fun onUnpaired() {
        //Your Code here...
    }
})

Show Connection

Display a view with current state and option to connect with two different method (bluetooth and websocket) and disconnect.

nearpayProxy.showConnection();

Connection Disconnect

Return true if there is a session to disconnect or attempt to new connect to stop. return false otherwise.

nearpayProxy.connectionDisconnect()

Get Connection Session

Return current session or null..

nearpayProxy.getConnectionSession()

Find session data here