We are definitely at the point where we use our mobile phones and tablets for just about everything. Everything from e-mail, reading, gaming, documents, and even banking. Especially with applications like banking there’s a certain expectation of quality and protection from the developers. There’s one API that has been available since API level 1 that provides a nice layer of protection without too much effort.
Android provides the ability to set the
FLAG_SECURE flag on a window. This prevents devices from being able to take
a screenshot when that window is on the screen as well as displaying the window on a non-secure display. This isn’t
exactly going to prevent someone from stealing data in all cases, but if someone was to get a hold of a device it would
at least be a little more difficult.
Including this on the more sensitive screens in your application is definitely an easy win. This is definitely not the only security precaution you should focus on, but one of many that eventually lead to a polished application.
Source (Gist) Snippet: Activity sample