Capabilities question for android

Hi folks, I’m looking at using JUCE to make a small app for a cognition experiment for my masters. It requires the app running in the background, notifying the user every X minutes (ie vibrating, or playing some non-standard un-pitched notification sound like some claps), and then making them take a quick test. I want to ensure JUCE will do what I want before diving in:

  • can one get the phone to vibrate typically even if not in vibrate mode?
  • or alternately, can the app just run in the background, waking up every X minutes to make a noise and engage the user? ( ie once an hour or so)
  • if the above, is there a way to ensure the batteries aren’t drained by having the app running in the background all day like that?

Sorry if these are obvious questions, I’ve done C++ and some JUCE, but zero native mobile dev.


I have personally never done vibration stuff, but I found in juce::PushNotifications::Notification there is some vibration functionality.

All this sounds totally possible to me. If the functionality you are looking for is not found in JUCE, I am sure you can easily access the Android API (via NDK) yourself in your JUCE app to achieve these things.

Here’s a forum thread on making your app wait: Best way to wait/sleep/delay?

Not sure exactly how to “background” a process, but you could always hide the application juce::Process::hide() and then when you want to notify the user you could juce::Process::makeForegroundProcess() and send the notification.

Hope this helps!

1 Like

Thanks Tim, much appreciated!

1 Like