3

I am planning on making a button that is when pressed sets an alarm on my phone. I am planning on making an app that is creating the actual alarm, the app just have to be triggered by the hardware button.

My questions are:

Is this possible without a server (or is there a way to send directly to the phone, bluetooth maybe?)?

Can the app be triggered even if it is not running? (The app should just be installed on phone but you don't have to open it in order for it to receive the signal)

Lukas Petersson
  • 131
  • 1
  • 4

3 Answers3

3

This is tricky. It would be easiest to run the Android app and wait for the button press. You can used off the shelf hardware like this IOIO board to do this. But then you have to ask your self if I am running the Android app then why do I not just press a button on the Android?

There are other ways to get an Android app's attention. But then you need to do something like running the app in the background. At this point you need to start thinking about battery life and what running something 24/7 in the background will do to the battery. It is absolutely possible to create an Android app that will significantly reduce battery life.

If you are comfortable with Android programming try and figure out how to run a program 24/7 with out draining the batteries which looks for an event driven by a button press. If not, consider reading more about IOIO programming. The IOIO board has been around for years now and there is a good possibility some like minded individual has already solve your problem.

st2000
  • 279
  • 1
  • 7
2

You could hack an Amazon Dash button since they are cheap.

Or use something like a raspberry Pi Zero W, which is also cheap.

And both of there are much cheaper than @hardillb's suggestion of Flic.io, where prices start at $34.99 for a single button.

If you don't like those for some reason, take a look at AdaFruit. They have some interesting wearables, such as the Flora which also has a BT Low Energy version.

Sounds to me like this is a fun learning project, so why not go a bit Rube Goldenberg and set your alarm by hairbrush?

Your app will need to be running on your Android (or something to wake your app, or something to wake that something ... there has to be something to realize that someone wants to talk to the phone, even if it’s just a broadcast listener).

Be aware of our Android enthusiasts sister site.

Mawg
  • 3,147
  • 1
  • 13
  • 35
1

For the app side, You could also use something like Tasker, it will need to be triggered by something, from what I understand you may need to add the MQTT plugin / broker to it.

Falz
  • 151
  • 6