// Top of ur .cs file
...
using AndroidCtrl;
using AndroidCtrl.Tools;
...
DeviceState state = ToolBox.CheckDeviceState("deviceID");
Check which state a device currently have.