Android Question Sounds Service Question

Discussion in 'Android Questions' started by TheSketchees, Feb 16, 2015.

  1. TheSketchees

    TheSketchees Member Licensed User

    I require to create a service which will be able to play MP3 sounds at certain times. I would like the service to be running when i click say "start" on my Activity and stop when i click "Stop". Would this be possible. Just want to be sure so the OS will not close it. I would like it to be like a timer which on tick if the clock is 12:00:50 to play the sounds then.

    BTW i have NEVER worked with services. I am creating this for work so we can replace the guys on the desk clicking the buttons to say stuff like "People wearing orange wrist bands please leave the trampoline area".


    Thanks,
    Alex

    Edit: DM worked out how to use services.
     
    Last edited: Feb 16, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    You have two options (and you can choose both of them):

    1. Call Service.StartForeground to tell the OS that you want to keep the service running.
    2. Use StartServiceAt to schedule your service to start at the next required time.
     
Loading...
  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