"light" web server for interfacing with android app


I want to make a web controlled android device. For simplicity let’s say I want to switch on an LED using a web interface.

I have a cheap 3rd party Ethernet adapter for a nano. To make a web site I am using the UIPEthernet library as it supports the hardware I have.

My issue is that my nano is running out of program space, due to the amount of HTML I have written in my client.println() statements.

I intended to make this program interface with an android app so my question is - how can I make a lighter web interface? Maybe not even a web “site” at all, but still some sort of server that can be pinged from an android app and respond. Most the HTML comes from formatting HTML to make the site look pretty, but I can easily offload that into android and let my app handle all the prettiness side.

I don’t know enough about networking to even know where to start. I noticed in the arduino sketch examples there are a couple of TCP and UDP servers, but I don’t fundamentally know what these are or how they work.

Any starting point would be appreciated,