But like no one would ever code that unless they were really bored or highTheoretically we could make an app that use wifi like ftp but it will transfer so slow the input lag would be unbearable , i think it is best for you to search and buy a bluetooth controller, i recommand 8bitdo they got great selection and are affordable.
Will take a lookI guess you could try edpjoy... it can control android input... I remember it has a keyboard... but I don't remember if it can be used... you could give it a try...