Android Question Make App run in background?

RishiKumar2210

Active Member
Hi Guys. I have created a project like an alarm clock. In the alarm clock, we have to set a time to ring a tone(mp3). But in my case. I have to set a time interval that too for multiple times. For Ex. I have set two time intervals 1 minute and 5 minutes. I want to ring an alarm after 1 minute from now for the first time, then I have to ring the alarm for a second time after 5 minutes from the ring rang the first time(Ex. 10.00A.M, 10.01 A.M(First Ring), 10.06 A.M(Second Ring). It works fine when the user is not closing the app. but when the user closes or minimizes it. It is not working. I want to make this task work in the background. how to do this? Here is My Project attached. What changes do I need to make? is there any line i need to make change in starter module in these lines?
B4X:
Sub Service_Create
    'This is the program entry point.
    'This is a good place to load resources that are not specific to a single activity.

End Sub

Sub Service_Start (StartingIntent As Intent)
    Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
End Sub

Sub Service_TaskRemoved
    'This event will be raised when the user removes the app from the recent apps list.
End Sub
 

Attachments

  • Alarm.zip
    78 KB · Views: 10
Top