From the course: Writing Secure Code for Android by Infosec

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Exception handling, part 1

Exception handling, part 1

- Let's talk about exception handling. What does that mean? What is exception handling? This is when you respond to and recover from some kind of error condition in your app. If you handle the exception, it lets you gracefully deal with the problem and continue the program execution. Exceptions in your app are one of the greatest problems in any kind of mobile app. And we want to make sure that we deal with them in a graceful way. We don't want our code to be buggy. We don't want the app to be unstable. One of the problems, not only will it crash and irritate your customer, but also, it could push weird values and unexpected behavior further down the road as the app continues to function. The old mantra is bug-free code is secure code. Here is Kotlin exception handling in a nutshell. Kotlin only has unchecked exceptions. What that means is a checked exception is discovered at compile time. Java had the ability to have checked exceptions. And with that, you could say, "Don't worry. If…

Contents