I found this application being a solution for automated task without draining your battery. The logic is simple, there is rule which contain trigger, action, and the name of the rule itself.
Here is an example : I always set my screen brightness to low or automatic to save battery. But then when I use camera, the screen is still on low brightness, it is not convenient to take pictures with low brightness. So I add rule in AutomateIt, if my camera is on, increase the screen brightness. Then if my camera is off, decrease the screen brightness (or set it to auto).
Another example : I always set my wifi enabled. Poorly, it always scan for open wifi network wherever I am, I think it will drain my battery. So I use AutomateIt to check if I were at home my wifi will be enabled, if I depart from home my wifi will be disabled. It use gps or coarse location (cell location) to locate me.
This app is available in Play Store, simply search the name "AutomateIt". There is also a paid version.
Install the app as usual installation.
There is a simple interface which contain My Rule, Market Rules, Setting, History, and More.
I will give example about increasing screen brightness when camera is on.
Add Rule, then choose "Application Status Trigger",
Select the application by touching the magnifier glass, there you can choose camera application.
In "Application Activated", check the option since this automation task will be run if the camera is on.
After that, choose "Next".
Select the action that will be automated when the camera is on, in this case is "Set the screen brightness action".
I set the screen brightness to 90++ but not 100, to keep my screen still eye-friendly. Then choose "Next".
Define the name of the rule, here I named it "camera on, full brightness". And I also set to pop-up the rule when it is launched, just to notify me. Then save it.
You can check the saved rules in "My Rules" section. If your new rule (camera on, full brightness) is enlisted, then your rule is good to go. Try it !
With the same step, you can set up revert rule to automate screen brightness level to "low" or maybe "auto" when the camera is off.