The X-Arcade acts like a keyboard on both MAME4Droid and MAME4All (except on Ouya), simply connect using the USB port. You can also make the X-Arcade work as an Xbox 360 gamepad instead. If your android device doesn't have a USB port, you can make it work wirelessly.

MAME4Droid
runs the most MAME games on an Android device. To use the X-Arcade on it simply tap on the screen outside of the center window to bring up Settings. Under Settings>Input you will want to set External Controller to 'Keyboard or IME', and then define the controls under Settings>Input>Define Keys to the layout shown below.

MAME4All only plays a limited number of older MAME games compared to MAME4Droid. To use the X-Arcade on it simply click on 'OPTION' on the screen, choose Settings, then define keys. You will want to set the controls up as shown below.
   

 

Function:Player 1
Player 2 
Stick UpNumpad 8R
StickDownNumpad 2F
Stick LeftNumpad 4D
Stick RightNumpad 5G
Stick BCtrl Left
A
Stick XAlt Left
S
Stick ASpaceQ
Stick YLeft ShiftW
Stick L1ZE
Stick R1X[
Coin or Stick Select34
Stick Start12
Exit

Option