This is an android port of phijor's ctroller for linux. The native binary source is here: https://github.com/hacker1024/ctroller-android. Read the readme there to set up your 3DS.
Your phone must be rooted with a uinput enabled kernel. ARM(64) only. If enough people say they'd like it, I'll look into Android TV support.