1. Download our Official Android App: Forums for Android!

Apps start app with power button

Discussion in 'Android Development' started by drcspy, Apr 26, 2012.

  1. drcspy

    drcspy Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Apr 26, 2012

    Apr 26, 2012
    2
    0
    5
    pc tech and geek type outdoors man
    new zealand
    Hello people

    New to android programming and I would like to create an app that runs when the power button is pressed (the phone will already be 'on' as such but the screen 'off')

    so - one press of the power button to 'activate/show' the screen will make the app run (without requireing the user to unlock the screen please).

    is this possible

    how do I capture the 'power button press' event and then direct it to run *app xxx*

    I thank you for your time in lookin at my question and I sincerely hope I can also one day help others (I have a fairly extensive history online of helping people with windows and hardware issues)
     

    Advertisement

  2. sohguanh

    sohguanh Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    427
    Joined:
    Apr 18, 2010

    As usual most ppl will recommend you to master Tasker. For your case it will be like what you say, if power on button then start app xx. Some recommend Llama though.

    Btw I am curious why you need such behavoir? You want to track how many times the user power on the button in some background service?
     
  3. Unforgiven

    Unforgiven ...eschew obfuscation...
    Moderator
    Rank:
     #2
    Points:
    4,488
    Posts:
    38,386
    Joined:
    Jun 23, 2010

    Jun 23, 2010
    38,386
    47,727
    4,488
    Male
    Douglas, MA
    I've moved this to the application development forum so you can get some better eyes on it.:)
     
    drcspy likes this.
  4. drcspy

    drcspy Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Apr 26, 2012

    Apr 26, 2012
    2
    0
    5
    pc tech and geek type outdoors man
    new zealand
    sohguanh nope I'm just wanting to activate an app that uses voice to notify the user of an event/process/ etc wihtout having to log in to the screen as such
     

Share This Page

Loading...