• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Change wallpaper depending on battery percentage

MarcoKun

Lurker
Hello forum, I'm new on here. Just made an account to share this idea I have.

I was thinking about an app which changes the wallpaper depending on the battery percentage. You can select a folder with images to use. It should use images something like this:

100-96% = Image01.jpg
95-91% = Image02.jpg
90-86% = Image03.jpg

And so on. The user should be able to select either steps from 5% or 10%, or perhaps 1%, if he/she has 100 different images.

Not sure if this is possible, but I think it would be great!
I don't know if this is necessary, but I'm using a Samsung Galaxy Note with Android 4.0.3.

Kind regards,

Marco
 
Thanks for the welcome, dreadnatty08!
I will check out this Tasker app. First I will try to set up a profile myself :P

Marco
 
I was directed to this part of the forum in this thread:
http://androidforums.com/applicatio...e-wallpaper-depending-battery-percentage.html

What I'm trying to do is change the wallpaper of the homescreen depending on what percentage my battery has.

For this I figured I would need Event --> Power --> Battery Changed as a Profile, I assume. As for the Tasks I would like different wallpapers when the percentage is as follows:

1 - 5% = Picture1
6 - 10% = Picture 2
11 - 15% = Picture 3
16 - 21% = Picture 4
etc.

I tried to use the Less Than option setting it like:

Picture1 if %BATT < 6
Picture2 if %BATT < 11
Picture3 if %BATT < 16
Picture4 if %BATT < 21

It works, although when the power is on 14%, I already see Picture4, for example.

Also, I constantly have "No active profiles" as ongoing message in my taskbar. Why is that?

Kind regards,

Marco
 
To make it easier for you I merged your two threads together in the tasker forum. Welcome to Android Forums.:)
 
For this I figured I would need Event --> Power --> Battery Changed as a Profile, I assume.
I think I might use a time profile something like every 15 minutes instead.
Your profile will probably fire less often, and the monitoring may not cost as much. A finer point... should work either way.,

Picture1 if %BATT < 6
Picture2 if %BATT < 11
Picture3 if %BATT < 16
Picture4 if %BATT < 21

The way you've got it, you'll execute several wall paper commands each time which seems wasteful and you might not end up with the right one. In fact you will probably always end up with the one that is the highest range (<100) because that's the last statement executed and it'll almost always be true.

There's a number of alternatives. How about this instead:
If %BATT<11... set wallpaper picture01to10.... STOP... END IF
If %BATT<21... set wallpaper picture11to20.... STOP... END IF
If %BATT<31... set wallpaper picture21to30.... STOP... END IF
...etc..
If %BATT<81... set wallpaper picture71to80.... STOP... END IF
If %BATT<91... set wallpaper picture81to90 STOP... END IF
If %BATT<101... set wallpaper picture91to100.... STOP ... END IF
That way only one of the commands will be executed each time, and it will be the right one.

Also, I constantly have "No active profiles" as ongoing message in my taskbar. Why is that?
Your talking about when you pull down on the notification bar? Yes, that is always there on mine. Tells me what is active. It's also how I get to Tasker. Not a problem for me.

Note if you have something in the notification bar above (even when not pulled down), you can get rid of that in the Tasker settings.
 
I think I might use a time profile something like every 15 minutes instead.
Your profile will probably fire less often, and the monitoring may not cost as much. A finer point... should work either way.
Thanks for your reply! I will think of doing that instead, I want to get it to work first.

There's a number of alternatives. How about this instead:
If %BATT<11... set wallpaper picture01to10.... STOP... END IF
If %BATT<21... set wallpaper picture11to20.... STOP... END IF
If %BATT<31... set wallpaper picture21to30.... STOP... END IF
...etc..
If %BATT<81... set wallpaper picture71to80.... STOP... END IF
If %BATT<91... set wallpaper picture81to90 STOP... END IF
If %BATT<101... set wallpaper picture91to100.... STOP ... END IF
That way only one of the commands will be executed each time, and it will be the right one.
Do you mean something like the attachment I added? Wouldn't that cause a problem too, as something which is below 64% would also be below 67%?

EDIT: I'm stupid, I know what you meant. Don't mind this anymore.
I don't know how to add multiple pictures to the If %BATT<11 statement. I assume you said "picture01to10" in case I have 100 images for each percent of the battery? I'm not sure yet, maybe I will only have one each 5% of the battery, or something like that.

Your talking about when you pull down on the notification bar? Yes, that is always there on mine. Tells me what is active. It's also how I get to Tasker. Not a problem for me.

Note if you have something in the notification bar above (even when not
pulled down), you can get rid of that in the Tasker settings.
It's not really a problem, but yes I mean when I pull down the bar, but also a logo on the bar when I don't pull down. I found the setting to remove that. Indeed it's an easy way to get to Tasker, only problem I'm having is that whenever I click on something in the notification bar, my phone locks and asks for my security pin. This has nothing to do with Tasker though, probably with Go Locker or Go Launcher.

Thanks for your help.

Marco
 

Attachments

  • Screenshot_2013-02-20-09-11-17.jpg
    Screenshot_2013-02-20-09-11-17.jpg
    143.6 KB · Views: 173
Try this

New profile - add state - hardware - power - power level - specify a 10% range (100 on 'from' and 90 on 'to')

Then' task' a picture to that trigger

This would mean you'd have 10 profiles to go from 100-0% but it would be a much simpler way to achieve the same thing.
 
There's a number of alternatives. How about this instead:
If %BATT<11... set wallpaper picture01to10.... STOP... END IF
If %BATT<21... set wallpaper picture11to20.... STOP... END IF
If %BATT<31... set wallpaper picture21to30.... STOP... END IF
...etc..
If %BATT<81... set wallpaper picture71to80.... STOP... END IF
If %BATT<91... set wallpaper picture81to90 STOP... END IF
If %BATT<101... set wallpaper picture91to100.... STOP ... END IF

I could be entirely wrong, but even with that the last thing tasker reads is for a full battery.

As computers read code the same way we do, top left to bottom right, you'd need to reverse the above values to make the wallpaper change as the battery depletes. That way as the code is read, it'll get to 67% and change the wallpaper, then read on and ignore the rest because the battery level is a greater value than the next lowest "if statement"

At least, that's how it makes sense in my head anyway.
 
Thanks for the reply, XplosiV.

I thought the same, that it wouldn't work that way. But it seems to work right now for me. My phone wasn't at a 100% when I started this today so I will see when my phone is fully charged.

You option seems good too, sounds easier to add compared to the "IF, Stop, End If" options.

Marco
 
Thanks for the reply, XplosiV.

I thought the same, that it wouldn't work that way. But it seems to work right now for me. My phone wasn't at a 100% when I started this today so I will see when my phone is fully charged.

You option seems good too, sounds easier to add compared to the "IF, Stop, End If" options.

Marco

Happy to help chap, whatever works best.
 
This would mean you'd have 10 profiles to go from 100-0% but it would be a much simpler way to achieve the same thing.
It could be simpler... it's in the eye of the beholder.

In general, use of cpu overhead would be a factor to consider in selecting a strategy...I&#8217;m not sure which approach wins in this respect (maybe someone else has ideas on this).

I could be entirely wrong, but even with that the last thing tasker reads is for a full battery.

As computers read code the same way we do, top left to bottom right, you'd need to reverse the above values to make the wallpaper change as the battery depletes. That way as the code is read, it'll get to 67% and change the wallpaper, then read on and ignore the rest because the battery level is a greater value than the next lowest "if statement
It is an attempt to implement &#8220;select case&#8221; logic using if/then blocks.
Once an &#8220;if&#8221; condition is satisfied and associated wallpaper is set, the &#8220;stop&#8221; statement terminates the profile&#8217;s task without any further execution. So if battery level were 67%, then none of the if/then conditions are satisfied the until the <71% check, which will execute, set the wallpaper to the item which would be labeled 61-70, and then stop (the <81% check and later checks will not be executed).

If the block structure with stops bothers you, you could change each "if" statement to include two conditions: one in the normal "if" condition and the 2nd by checking the "if" box in the set wallpaper action dialogue box. With two conditions per "if", you can specify the top and bottom of a range. 10 such statements could define 10 non-overlapping ranges 1-10, 11-20, 21-30 etc

Yet another approach, divide the battery level by 10 and truncate the result using the floor command. Then you can check whether the result matches 0, 1, 2, 3, 4... etc.

As usual, many ways to skin a cat. I'm sure others could come up with more.
 
Back
Top Bottom