using ClientDeviceListener to improve the Demo