Run app in background, that fires an alarm whenever phone is shaking

So I am making a small alert app that fires an alarm whenever phone is shaking. Is there anyway to let the app run even when you close the app or the phone is off? Thank you

Try the itoo extension for this

Guidelines for using Itoo

  • First get your background functionality running in the foreground. Like this, you can find errors much easier. And as soon as you got it working in the foreground, then test it in the background.
  • Read the complete Itoo to leaarn how Itoo works and try the example projects, See also the battery checker tutorial and notification listener and itoo tutorial .
  • Do not use global variables while in the background, use local variables instead
  • Do not use any user-visible or UI components in the background
  • In the background, use the Itoo StoreProperty/FetchProperty methods rather than TinyDB. TinyDB relies on SharedPreferences which will not ensure data synchronization across background processes.

Taifun

1 Like

Ok thank you so much! I'll try it and send updates thanks again

here is a small test project to get you started
after shaking, a voice tells you how many times you already shaked

shakeIt.aia (69.6 KB)

Taifun

4 Likes

Playing mp3 files seems impossible I don't know what to do

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thank you but I've already found a solution. Turns out I just didn't understand the extension enough :slight_smile:

Don't hesitate to show us your solution here to help others with the same question in future

Taifun

1 Like