[APP][4.1+] Powy - Use different shortcuts/Tasker Tasks through your power button

danilo.mendes

Member
Mar 15, 2017
12
4
0
Powy

Powy gives you access to handy shortcuts through the power button. To trigger a shortcut you simply have to press the power button N times (you define how many times) and then the shortcut is triggered.

Powy provides the following shortcuts that you can use:
  • Hear the current time
  • Turn on or off your flashlight / torch / LED
  • Open camera app
  • Record audio

All of the shortcuts listed above work even if screen is off and/or device is locked. Does not have to be open or in recent apps to work.
You can enable only the shortcuts you want to be usable. You can configure shortcuts key combinations per shortcut. And you can start or stop Powy at any time.

Download
https://play.google.com/store/apps/details?id=com.danilomendes.powy

How to use?
Start Powy by pressing the button in the main screen of the app. Now to trigger the shortcut you want simply press the number of times configured in that shortcut (listed in the main screen).

Story behind Powy
Initially I've developed Powy only for my own needs, the initial purpose of Powy was to simply tell me the current time when I was using headphones, because I use headphones a lot and I'm kind of obsessed with time and I hated to have to take my phone out of my pocket to see what time it was. I developed a quick draft for myself and then now I figured that the app might be helpful to other people.

How it works - Technical description
Since we cannot actually listen to power button key events on background, Powy actually listens to screen on/off events and then after 0.714 seconds, after the last pressed key (maximum of 1.5 seconds), Powy sees if the total number of screen on and off's matches a shortcut and triggers it.

Permissions
  • RECEIVE_BOOT_COMPLETED - For the app to start running upon boot. This can be turned of whether or not you have Android 6+. You can turn it off on the Preferences section within the app.
  • CAMERA - *Only for Android versions below 6* This is simply used to use the flashlight.
  • WAKE_LOCK - Only used for the camera shortcut when it's triggered with the screen off. Powy does not keeps the wake lock for more than 100 ms after the camera shortcut is triggered.
  • FLASHLIGHT - For the flashlight.
  • RECORD_AUDIO - To record audio only when the record audio shortcut is triggered.
  • WRITE_EXTERNAL_STORAGE - Powy only uses this to write the recorded audio to the sdcard.
  • VIBRATE - Only to vibrate when record audio is triggered.
  • ACCESS_NETWORK_STATE & INTERNET - These two permissions are used by admob.

Try it and tell me what you think :)
I'm available to respond through this forum or through here.

Cumps,
Danilo Mendes
 
Last edited:

danilo.mendes

Member
Mar 15, 2017
12
4
0
Whenever I try to get the >2 actions to run, I usually fail and it always just reads me the time. Maybe the 0.5s threshold is too low?
Hi thank you for replying.

I wrote the incorrect value, the threshold is actually 0.714 seconds. But in any case, try not to press the power button too quickly.
I think if it recognizes two screen on/off's it means it can capture more than that, meaning that the threshold is probably enough, but maybe the maximum time of 1.5 seconds it has to joins presses might not be sufficient.

But try not to press the power button too quickly and tell me how it goes.

Cumps,
 

overcoded

New member
Jan 26, 2012
3
0
21
The only one that works for me is "Tell me the time" on a Pixel XL running 7.1.1. I would totally donate if I could use this to toggle my flashlight.
 

danilo.mendes

Member
Mar 15, 2017
12
4
0
Doesn't run on op3t.. freedom os7.1.1
Hi,

I honestly haven't tested on freedomOS. Can you please give me more info on this? Does the app crashes? The shortcuts are not being triggered?
If the app does not crash try to press the power button calmly, because Powy actually depends on screen on/off events.

Keep me posted on this issue, thank you.

Cumps
 

danilo.mendes

Member
Mar 15, 2017
12
4
0
The only one that works for me is "Tell me the time" on a Pixel XL running 7.1.1. I would totally donate if I could use this to toggle my flashlight.
Hi, thank you for the feedback. Please note that Powy actually relies on screen on/off events. Try not to press the power button too quickly and confirm if the flashlight shortcut is ON (the switch is on).

Also, if you want, you can change the flashlight shortcut to 2 times power button . You just have to change the shortcut to '2 x Power button' simply by clicking on edit:


Cumps
 

sugerdroid

Member
Apr 24, 2014
16
7
0
NYC
It currently doesn't work for me on the LG G5 running Marshmallow. I tried using only the time function and pressing twice both quickly and slowly. Neither scenario triggers the action. This is a really cool idea and thanks for the app -- I hope I can get it working on my setup.
 

earthplug

Member
May 7, 2016
11
4
0
Bangalore
Hi,

I honestly haven't tested on freedomOS. Can you please give me more info on this? Does the app crashes? The shortcuts are not being triggered?
If the app does not crash try to press the power button calmly, because Powy actually depends on screen on/off events.

Keep me posted on this issue, thank you.

Cumps
The app doesn't load at all just flashes and that's it back to home screen.
 

overcoded

New member
Jan 26, 2012
3
0
21
Hi, thank you for the feedback. Please note that Powy actually relies on screen on/off events. Try not to press the power button too quickly and confirm if the flashlight shortcut is ON (the switch is on).

Also, if you want, you can change the flashlight shortcut to 2 times power button . You just have to change the shortcut to '2 x Power button' simply by clicking on edit:


Cumps
Thanks for the reply, I have tried both slow and fast power button presses, as well as waiting for the screen to turn off before initiating more presses. Like I said, "say the time" does work, so I know what the timing is supposed to be like.
 

GokulNC

Senior Member
Jan 10, 2015
827
1,393
0
Chennai
github.com
@danilo.mendes Cool idea bro..
I guess the reason why users are facing problems is that the time taken to receive consecutive SCREEN_ON/OFF broadcasts vary for different devices..
Instead of hardcoding the threshold value, you can get the data from user itself..

While opening the app for first time, you can ask the users to consecutively press the power button for N times for calibration purpose (N is your wish).
While the user is doing that, you may record (in your Service) the threshold timings between the SCREEN_ON/OFF broadcasts and compute the average for N trials.
And finally set that as threshold value.

That way, you may get the app working for all devices..
Hope my words are clear ;)
 
  • Like
Reactions: danilo.mendes

danilo.mendes

Member
Mar 15, 2017
12
4
0
@danilo.mendes Cool idea bro..
I guess the reason why users are facing problems is that the time taken to receive consecutive SCREEN_ON/OFF broadcasts vary for different devices..
Instead of hardcoding the threshold value, you can get the data from user itself..

While opening the app for first time, you can ask the users to consecutively press the power button for N times for calibration purpose (N is your wish).
While the user is doing that, you may record (in your Service) the threshold timings between the SCREEN_ON/OFF broadcasts and compute the average for N trials.
And finally set that as threshold value.

That way, you may get the app working for all devices..
Hope my words are clear ;)
Hi, Yeah it seems like that's right. That's a really cool suggestion, thank you :) I'm going to use a mix of your suggestion, because I want to avoid complicating the setup for the first time users. So instead of asking the user, I'm thinking about calculating the threshold automatically for the first time then use those values by default. And also adding a preference for the user to configure the threshold and the max time.

I'll update the apk version asap with this changes. Again, thank you :)

Cumps

app crashes immedietly after introduction ends
my currents are in my signature
The app doesn't load at all just flashes and that's it back to home screen.
Hi both, Thank you for the feedback. I just got a crash report related to the TTS (Text-To-Speech) and I'm going to fix it and include it in the next client that I'll upload very soon.

Cumps

It currently doesn't work for me on the LG G5 running Marshmallow. I tried using only the time function and pressing twice both quickly and slowly. Neither scenario triggers the action. This is a really cool idea and thanks for the app -- I hope I can get it working on my setup.
Hi
Only flash shortcut works for me.
Salmusng S5 (neo), Android 6.01 stock.

However good app, thanks!
Hi both, Thank you for the feedback :) Like GokulNC said, some devices seem to have more different times of screen off/on events than I expected. For this reason I'll develop some changes to make this more flexible and hopefully this will fix your issues. This will be in the next release that I'll release very soon.

Cumps
 

danilo.mendes

Member
Mar 15, 2017
12
4
0
@danilo.mendes Cool idea bro..
I guess the reason why users are facing problems is that the time taken to receive consecutive SCREEN_ON/OFF broadcasts vary for different devices..
Instead of hardcoding the threshold value, you can get the data from user itself..

While opening the app for first time, you can ask the users to consecutively press the power button for N times for calibration purpose (N is your wish).
While the user is doing that, you may record (in your Service) the threshold timings between the SCREEN_ON/OFF broadcasts and compute the average for N trials.
And finally set that as threshold value.

That way, you may get the app working for all devices..
Hope my words are clear ;)
Thanks for the reply, I have tried both slow and fast power button presses, as well as waiting for the screen to turn off before initiating more presses. Like I said, "say the time" does work, so I know what the timing is supposed to be like.
app crashes immedietly after introduction ends
my currents are in my signature
Hi
Only flash shortcut works for me.
Salmusng S5 (neo), Android 6.01 stock.

However good app, thanks!
Doesn't run on op3t.. freedom os7.1.1
The only one that works for me is "Tell me the time" on a Pixel XL running 7.1.1. I would totally donate if I could use this to toggle my flashlight.
It currently doesn't work for me on the LG G5 running Marshmallow. I tried using only the time function and pressing twice both quickly and slowly. Neither scenario triggers the action. This is a really cool idea and thanks for the app -- I hope I can get it working on my setup.
Hi everyone,

Powy 1.0.2 released
Added:
  • Now the threshold and max time of key presses and shortcuts are configurable
  • Fixed crash caused by no TTS engine in some ROMs (e.g.: LG G5)
  • Added method to automatically find best threshold and max time when you use the first shortcut (only on clean installs)

Get it at: https://play.google.com/store/apps/details?id=com.danilomendes.powy

So now, hopefully, all issues should be resolved and the app becomes more flexible because you can configure the settings for each device and to your needs.

Tell me what you think about this new release and rate as you think it's fit :)

Thank you all for the feedback it was really helpful.

Cumps
 

danilo.mendes

Member
Mar 15, 2017
12
4
0
Hi guys,

Just wanted you to know that Powy now allows you to use Tasker Tasks through the power button. This is now available on version 1.1.0. I think that now by using Powy combined with Tasker you have a lot of flexibility customizing shortcuts on your power button.

For example, now you can add a task on Tasker that turns WiFi on/off and then fire it using your power button through Powy.

Give it a try and tell me what you think :)

Powy: https://play.google.com/store/apps/details?id=com.danilomendes.powy
Tasker: https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm
 
Last edited: