While connecting an Xbox one controller to a Windows PC via USB works fine after downloading the respective driver, I was wondering how to use it on an android device via USB OTG, or to an OUYA.
Android 4.0 or higher and a
wired controller it's just a Plug&Play via the USB OTG.
However there are games/mobile phone which aren't compatible for USB OTG.
To find out whether your mobile phone is, just google your mobile phone and add OTG.
To find out whether a game is compatible there is an app from NVIDIA (should be installable for any android device 4.0+) which checks the compatibility.
It is possible to use the controller via USB OTG, but your device MUST be rooted and it may be difficult.
First of all check your X1 controller DeviceId, on Windows you can do it through Device Manager: Device Manager -> Xbox Controller -> Properties -> Details -> Hardware Ids
VID should be 0x45e
PID will be either 0x2d1 or 0x2dd
Easy method for older controllers (0x2d1)
If you are running a ROM based on Linux kernel 3.18, then the controller will work out of the box! So you might want to flash a new ROM/Kernel if it's very important to you... This is probably the easiest solution.
Hard method for newer controllers (0x2dd)
If the above didn't work or you have the new controller, and you're not shy about recompiling the Android kernel, you can:
A. Download the Android kernel sources for you device (see instructions h-ttps://source.android.com/source/building-kernels.html)
B. In the kernel sources, replace the file xpad.c under /drivers/input/joystick/ with the newest sources from here: h-ttps://github.com/paroj/xpad
C. Rebuild the whole kernel and replace your boot image, or just build xpad as a kernel module and load it using insmod from the adb shell