I'm trying to get started on a simple project where I execute some script or some cmd command via a "button" on my phone. For starters I just need to figure out how I set up the interface from phone to PC. All I'd need the PC to do initially is just "receive" the signal so it knows it should execute whatever it's set up to do.

I'm ideally looking for something using Python but I know some C++ but am up for learning just about any language. I would appreciate any hints or suggestions as to what libraries or tech I should look into using.

It would indeed be easier to just use any remote desktop application but I was thinking it would be a fun project to try and write something specialized and on my own.


Set up a server on your PC. If Linux, you already have Apache and PHP, and probably Python. If Windows, install XAMPP.

Simplest of all, the PC can serve an HTML page with a button, then you can just browse to it on Android and click.

If you want something slightly more complex, use a RESTful API and send an HTTP(S) request from Android to PC. It doesn’t need to have a GUI if you don’t want to. You can just send an AJAX request.

E.G some Python or C++ on the Android shows a button, the user clicks it and your Android code sends an HTTP(S) request to http://<server>/button_clicked.py.

Once you advance a little, you might want to visit our Internet of Things sister site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.