Initialize

The entry point for interacting with the D'CENT biometric wallet device is the DcentManager, so you must create and initialize a DcentManager instance.

And find out if the D'CENT wallet is connected, DcentManager.Observer interface should be implemented.

sample

public class MainActivity extends Activity implements DcentManager.Observer {
	// DcentManager Object
	DcentManager mDcentmanager;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mDcentmanager = new DcentManager(this); // Create DcentManager Object
		mDcentmanager.subscribe(this); // Subscribe DCENT event using DcentManager.Observer
		mDcentmanager.initialize(); // Initialize dcentmanager
	}
	@Override
	protected void onDestroy() {
		//Unsubscribe DCENT event using DcentManager.Observer
		mDcentmanager.setDcentManagerUnSubscribe(this);
		super.onDestroy();
	}
	///// override DcentManager.Observer interface
	@Override
	public void dcentDongleConnected() {
		//TODO: Add your code
	}
	@Override
	public void dcentDongleDisconnected() {
		//TODO: Add your code
	}
		/////
}

Last updated