Today's Question:  What does your personal desk look like?        GIVE A SHOUT

Android Hardware Buttons are not broken, let me tell you why

  Steven Van Bael        2011-11-03 13:38:21       4,662        0    

This post is written as a reaction on Christoffer Du Rietz’s article The Android Hardware-Buttons Are Broken. In his article Christoffer explains how the Android back button shows inconsistent behavior like doing different actions when it is used on the same screen.

In the following article I will try to explain that this behavior is not broken. Instead it is exactly what the Android developers had in mind while designing the back button behavior.

The way the back button is broken according to Christoffer

Christoffer’s example case is the Twitter application. In scenario 1 he is doing something outside of the application, receives a mention notification and taps it. This takes him straight to the mention screen. Now when he presses the back button, the twitter screen closes and Android takes him back to what he was doing before (in his case the home screen). This is not what he expected. Christoffer expected to see his main Twitter timeline. (why? he was never there).

I don’t believe part of scenario 2 he is describing. Christoffer says he opened the twitter app again and claims it went straight to the last mention he saw. If Christoffer did this right after scenario 1 (in which he pressed the back button after reading the mention), it is impossible that the Twitter app shows this last mention. This could only happen if he did not exit the mention screen with the back button, but rather with the home button itself, or if he re-navigated to this mention through opening the app, and tapping the tweet.

I will assume he used this last option to arrive at this mention screen again. Now when he presses the back button, he arrives  back at the main timeline where he came from. Now Christoffer is confused because the back button has lead to two different outcomes when pressed on the same screen.

Why does Android take him to different screens? Some theory first

Android is a true multi-tasking OS. What this means is that instead of opening one app, using it and then closing it to go to another app. Android apps are interleaved as the user switches between them on a regular basis. This interleaving happens on the screen level, or Activities as they are called in Android jargon. Every screen in Android is an activity. Even the home screen is nothing more than an activity bound to the home key.

Interleaving these activities works as follows: When the user performs UI interaction on any given activity, there are 2 possible actions:

The activity gets closed and the user is taken back to the previous activity
This usually happens when the user clicks the back button or performs an action that needs to close this activity.
The user is taken to another activity
Typically when clicking a button inside the activity, or when using the notification area or home button. The resulting activity does not have to be from the same application.
Let’s try explaining Christoffer’s “inconsistent” back button behavior with this theory

In scenario 1, initially he starts out on the home activity. He sees the new mention notification in the notification area and taps it. This takes him straight to the mention activity. If he taps the back button, the OS will close this mention activity and take him back to what he was doing before he tapped the notification (the home activity).

In scenario 2, he starts out on the home activity, taps the twitter icon and this opens the main timeline activity. He taps a tweet and is taken to the tweet/mention activity. Now if he presses the back button, the mention/tweet activity is closed and the OS takes him back to the previous one. In this case the main timeline activity. One more press of the back button and he would be arriving back at the home activity.

Concluding

Is this still inconsistent behavior? Not at all! The back button always takes you back to the previous activity. This does not necessarily mean the same application. The big mistake Christoffer made in his post is that he was thinking the back button should behave on the app-wide screen level instead of the OS-wide activity level.

Now, I can understand why he made this mistake. The way multitasking is done in Android is quite new and differs greatly from the way we interact with different applications on other mobile OS’es like iOS and on Desktop OS’es. On most other OS’es there is no such concept as a system-wide back button. On iOS there is a back-button concept but that works on app-level, which is why I think Christoffer regarded the Android back button as broken.

ANDROID  BUTTON  HARDWARE  PROTECT 

Share on Facebook  Share on Twitter  Share on Weibo  Share on Reddit 

  RELATED


  0 COMMENT


No comment for this article.