1. Are you ready for the Galaxy S20? Here is everything we know so far!

General power button

Discussion in 'Android Devices' started by andybog, Aug 8, 2013.

  1. andybog

    andybog Guest
    Thread Starter

    Hi all, I am after an app that performs the same function as the physical power button (ie quick press screen off, long press for menu that includes reboot, flight mode etc) but is a widget/shortcut on the home screen.

    Anyone recommend one?

    Ps I am rooted.

    Cheers
     

    Advertisement

  2. SebaKL

    SebaKL Android Enthusiast

    What you are looking for is "soft power button".

    I have never used one, but seem like this one is a popular choice, given the number of downloads:
    Power Toggles <---

    You might want to search Google Play and look for one with highest star rating.
     
    scary alien likes this.
  3. andybog

    andybog Guest
    Thread Starter

    Just thought I'd update where I'm at with this just in case someone else is after a solution.

    I have used Power Button app by Torcellite from the store. You can turn the screen off and access the same long press power button menu you get if you use the physical button.

    It needed a source code tweak to work properly but instructions and the code are available from his github page. Even i managed to do it, and I have zero knowledge of programming.

    If anyone needs a step by step guide i will post it.
     
    funkylogik and scary alien like this.
  4. andybog

    andybog Guest
    Thread Starter

    Guide

    1 Download and install AIDE from play store (free edition will do)
    2 Open AIDE and click cancel on the pop up window.
    3 Click 'clone git repository here' and put Https://github.com/torcellite/Power-Button.git in the 'repository url' and press 'clone' Allow it download all files
    4 navigate to src/main/java/org/torcellite/powerbutton/ExecuteEvents.java
    5 find the four lines that contain the following code " + z + " and replace it all with a 1 (replace the apostrophes, pluses and z with a 1)
    6 press menu then select save
    7 press menu then select run, it will do some stuff then prompt to install
    8 ENJOY!
     
  5. scary alien

    scary alien not really so scary
    Moderator

    Wow, Andy--thank you for this! :)

    I think the power-button remapping information you provided is very cool, but I had never heard of AIDE! :thumbup:

    I never imagined that you'd be able to do Android app development on your own Android device :cool:. I dabble a bit with app development and here have been times that I've wanted to make a tweak to one of my apps and I was not at home at my desktop to use Eclipse to make the changes, etc. This could come in very handy.

    Your example of using the Power Button app with AIDE is just icing on the cake!

    Many thanks! :)
     
Loading...

Share This Page

Loading...