Android Question Creating an alarm clock

Discussion in 'Android Questions' started by An Schi, Feb 7, 2019.

  1. An Schi

    An Schi Well-Known Member Licensed User

    Hey people ;)

    I haven't done any coding for over a year, but now i want to make something. So please forgive me my noobiness and the fact that i didn't keep up with all the changes in B4A and in Android :oops:

    For a friend i want to make a wake-up alarm clock, cause she isn't comfortable with the stock one.
    Her phone is a Samsung Galaxy S7 with Android 8. I have B4A 6.? (but i'm thinking about buying the newest).
    I want to start working on it on the weekend, so i have no code or problems yet. But i wanted to make sure to go down the correct way before i sart ;)

    My plan is to work with a foreground service and a notification. Is this the correct approach?
    When i was last active here, there were problems with services started too late. Is this solved by using foreground service (the alarm has to be on time of course)?
    Will i have to deal with runtime permissions in this project?
    Do you have any other hints or links i should read?

    Thank you for your help :)
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should use StartServiceAtExact and set the DuringSleep parameter to True.

    It is however possible that it will not work properly on all devices. There are some devices that do not allow you to start anything in the background.

    Also make sure to read: Automatic Foreground Mode
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice