Jump to content

Hello there,

 

As a fun holiday project, I want to program a custom doorbell. When I press a Bluetooth button (one of those cheep ones from selfie sticks), I want a python script (running on my phone) to recognize it. As far as I am aware, Android automatically creates a "Media-Button-Pressed" type of event. I simply cannot find a python script, that listens for this event.

 

I already found solutions in Java for this problem, but since the only language I'm somewhat familiar with is pyhton, I'd like to use the mentioned programming language.

 

Thanks in advance.

Link to post
Share on other sites

It is highly recommended to NOT do this with python. Android do not run python code without some hacks like BeeWare. At best you'll have to write a small Java or Kotlin and then call some python code in the backend. But since that will rely on the Android NDK it will be way more complicated than just learning a bit of Java. 

 

If you want to develop something for Android, use Kotlin or Java. You will have a bad time otherwise. I promise you. 

Link to post
Share on other sites

If programming isn't the point of the project, I think you could just use an app like MacroDroid.

“Remember to look up at the stars and not down at your feet. Try to make sense of what you see and wonder about what makes the universe exist. Be curious. And however difficult life may seem, there is always something you can do and succeed at. 
It matters that you don't just give up.”

-Stephen Hawking

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×