fred basset
fred basset

Reputation: 10082

Android : what is the standard way to display errors to the user?

I've just inherited an Android app. and have been tasked with making some modifications to it. The target device is a Nexus 7. One area that needs improvements is displaying of errors. Currently errors look like they are just displayed as raw JSON text at the bottom of each screen.

What is the preferred way of displaying errors in Android? Popup dialog, or something else?

Thank you, Fred

Upvotes: 1

Views: 801

Answers (3)

Blo
Blo

Reputation: 11978

A first way, Toast is an easy and fast widget to notify errors, but this widget has the particularity to not been attached to the Activity where they were called. Sometimes, the user doesn't have the time to see the error. Also, it happens that when the user quits the application, if a Toast is called, the message is still shown whereas the app is not displayed on his device. It's not really "beautiful".

Another might be a Dialog (popup), this is a good way to display any errors or important messages. The error is really visible and it is confirmed with its buttons (OK, Cancel, ..) that the user has been well informed. But, in personal feeling, I find this way too intrusive..

I'd suggest you to use Crouton (by Benjamin Weiss) to notify users for errors, infos and messages from your application. You can find a good explanation on Useful Android Libraries: Crouton. The concept is:

[...] to show in-app notifications (not to be confused with Android's persistent notifications) at a fixed place of the Activity to which the notification is relevant. This way the context of the notification is always correct.

This is a notification inside your app, like a Toast but always attached to your Activity. You can download a sample on Google Play and this library on GitHub.

Upvotes: 2

I'm_With_Stupid
I'm_With_Stupid

Reputation: 1112

The standard way to display errors is through a popup, usually with an ok button and more actions if needed. Toasts are not user friendly enough for the user because sometimes the user misses the error and then feels like it might have missed something important.

Source and for more information on popups: http://developer.android.com/guide/topics/ui/dialogs.html

Edit: Also all google devices (aosp) use popups to show errors (infamous force close error is a good example), so it would be in line with the Nexus 7's UI.

Upvotes: 0

Raz
Raz

Reputation: 9058

I'm not sure there is a standard way of showing errors. I suppose that it depends on the error type. If the error needs a user action, than popup with buttons is the way to go. If it's just informative, than a toast will suffice with a short text. Just make the error text "user friendly" if it's really needed to be shown to the user. It should not be in a Json format.

Upvotes: 1

Related Questions