11-03-2012 07:48 PM
I want to listen to changes on the screen of the phone, I seen peter made a suggestion in another thread a couple of years ago which entailed using locateDfference, however he noted a potential hole in his suggestion where in the case when the timer icon is showing - the screen is always changing but not really relevent changes to the screen are taking place, only the network indicator and timer icon trigger the changes.
I am now trying to fill them holes, my code is detecting the difference in bitmaps from screenshots, the code works but when the garbage collertor is active it is triggering a change detected in my code.
I am thinking the simplest option is to ask the api is the garbage collector active - I have printed out visible applications and the garbage collector is never one of them but I do see the processid is changing all the time and so maybe one of these processid I see in the console is the garbage collecvtor and I can detect when this is active - anyone know if i can find the processid of the garbage collector or listen for whern it is active (showing the timer icon)?
If this is not possible then maybe if I can get correct ratio for the timer per size of screen then i can work around the icon.
Any suggestions how to overcome my problems are welcome.
Solved! Go to Solution.
11-05-2012 03:26 AM
11-05-2012 08:13 AM
Thank you for your reply Simon.
Can anyone give me suggestion as to how to know when the timer is active? - it would save a lot of battery power!
11-05-2012 09:42 AM
Thanks for replying Peter, the app loops taking a screenshot and comparing this screenshot to lastBitmap, if there are changes it will send these changes over socket - I might be able to detect centre of screen if I can workout a constant size of timer per screen size - but for now I'm investigating the simpler way of detecting if the timer is visible. Yes it does currently trigger changes and therefore network activity so i assume its able screenshot when the timer shows.
11-05-2012 10:00 AM
ok, thanks anyway. Maybe I can detect centre of screen and workout the size of timer icon and skip it - ill do some tests on different size screens once i am at that stage to see if i can always workout size of timer icon.