Compartilhar via


Forceful home screens on Smartphone devices

Another great question from the Smartphone developer newsgroup today. The gist of it is: "Why does the Smartphone home screen pop in front of my application every 10 minutes, and how can I stop it?"

The Smartphone Home screen pops forward after the device hasn't detected any user input for 10 minutes. (The length of time can be configured in the home screen control panel). Why? Because the device is primarily a phone, and the home screen is where you have to be to dial. The assumption is that if the user hasn't touched the phone for a while, it's likely in a pocket or a purse and the next time it's whipped out for use it'll either be to place a phone call or to run an app, both of which require the home screen.

99% of the time this works great, but there are certainly some applications where this doesn't make sense. A great example is Windows Media Player while it is playing a video. Since the user is watching the movie it would be rather rude to have the home screen pop forward.

To let the device know your app really is doing something that the user is watching, call the SHIdleTimerReset() function. The smallest timeout that can be set through the control panel is 10 seconds, so calling this every 9 seconds or so is generally a safe way to ensure the home screen doesn't pop forward. If you are going to do this, think long and hard about whether it is the right thing to do. Don't do it just because you think your app is important. Think very carefully about whether the usage scenarios for your application warrant this change to the standard Smartphone behaviour. Also, if you do call this, make sure you stop calling it when your application is no longer in the foreground, and don't override the home key so the user can still press it to get back to the home screen if they need to.

[Author: Neil Enns]