Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Advise the User When Something Bad May Happen, but Don't Necessarily Prevent it.

DZone's Guide to

Advise the User When Something Bad May Happen, but Don't Necessarily Prevent it.

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Let's say you've built an app that needs to download a large amount of data. As part of trying to ensure the best experience for the people using the app, you've added code that detects the type and speed of connection the device currently has.

So, what if the device is on a particularly slow connection? And/or they're on a mobile data connection (rather than a wireless/WiFi one) and so the financial cost of the transfer may matter? Or maybe they're using roaming data, and so the cost of transferring the data could be considerable?

Downloading is Prohibited!

As you may have guessed from the title of this post, the thing you shouldn't do is stop the person from attempting to make the download.

To do so says that you know better than them what they want.

Doing so says that your idea about what should be allowed is more important than what the person using the app is trying to achieve.

The data the app needs may be really important to what the person is trying to achieve. The desire to access the data and/or use the app that they've opened (presumably to perform a specific task) may be worth the cost of obtaining or delay in accessing the data.

Asking the person using the app to confirm their actions in this case not only makes sense, but is recommended.

Asking for confirmation at this time allows you to make sure that the person is aware of the consequences of what they're asking the app to do by downloading the data.

"You appear to be on a slow connection. Downloading may take some time. Are you sure you wish to continue?"

"You appear to be using roaming data. Downloading the data may cost more than usual. Are you sure you wish to continue?"

Asking each of the above questions (or similar) as appropriate, when combined with a "Remember my answer" capability, can lead to happier users.

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. Our APIs verify, standardize, and correct the Big 4 + more – name, email, phone and global addresses – to ensure accurate delivery, prevent blacklisting and identify risks in real-time.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}