Hello all,
I have an application that needs the screen operation periodically (20 seconds or so every 8 minutes. The application works successfully using "Phone2.Keepalive(True)", but this holds the screen on continuously and, after an hour or so, just about melts the device. I am running the phone on an extrenal supply, but the battery is still depleted since the current draw is so high.
I have been experimenting with ways to 'wake' the Activity and manipulate the screen brightness by using "Keepalive" and setting the screen brightness with "SetScreenBrightness". This works poorly. "Keepalive" should keep the phone from locking, but setting a zero screen brightness yields a state where it is no longer possible to wake the activity. A screen brightness of 0.1 is still quite bright (& hot after a while) .
I think I need to look at another method - effectively zeroing the screen brightness until either the periodic task starts or if the screen is touched.
I have attached sample code (servicetest_powercontrol) I am using to explore this. It calls a sub (callsub) in the main every 30 seconds.
I welcome any suggestions on improving this.
I am considering using reflection as there seems to be positive commentry about controlling the screen in this way, but I don't really want to necessitate changes in the manifest to accomodate the screen control.
Many thanks,
refsmmat
I have an application that needs the screen operation periodically (20 seconds or so every 8 minutes. The application works successfully using "Phone2.Keepalive(True)", but this holds the screen on continuously and, after an hour or so, just about melts the device. I am running the phone on an extrenal supply, but the battery is still depleted since the current draw is so high.
I have been experimenting with ways to 'wake' the Activity and manipulate the screen brightness by using "Keepalive" and setting the screen brightness with "SetScreenBrightness". This works poorly. "Keepalive" should keep the phone from locking, but setting a zero screen brightness yields a state where it is no longer possible to wake the activity. A screen brightness of 0.1 is still quite bright (& hot after a while) .
I think I need to look at another method - effectively zeroing the screen brightness until either the periodic task starts or if the screen is touched.
I have attached sample code (servicetest_powercontrol) I am using to explore this. It calls a sub (callsub) in the main every 30 seconds.
I welcome any suggestions on improving this.
I am considering using reflection as there seems to be positive commentry about controlling the screen in this way, but I don't really want to necessitate changes in the manifest to accomodate the screen control.
Many thanks,
refsmmat