(Information and examples taken from the DroidScript documentation)
The GetJoystickName method gets the name of a HID Joystick or Gamepad (For example, an Xbox 360 controller connected to your device via an OTG cable).
app.GetJoystickName( joyNum );
GetJoystickName can get the name of multiple HID controllers currently connected to your device. Pass 0 to GetJoystickName for the first controller, 1 for the second, etc.
function OnStart() { name = app.GetJoystickName( 0 ); app.ShowPopup( name ); }