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.

Activity: Working with external code

Activity: Working with external code

- [Instructor] Understanding Risks of Embedding Third Party Code. Activity, working with external code. In Android Studio, open an existing project and browse for your activity files. Go to Course 7, Working with External Code. Select that little app and open it. This app is going to be very simple. We're going to show just how easy it is to call Java from Kotlin. Now, you'll recall in all of our discussions that Java has a lot more vulnerabilities than Kotlin. And because it's so easy to call a Java class, we might inadvertently introduce vulnerabilities in our app that we wouldn't have if we wrote in pure Kotlin. If you look here, you can see I have a Java class, its little icon is just a C, for class, and then I have a MainActivity written in Kotlin. Let's look at the Customer Java class first. We'll double-click it, and all it is is Customer. So, it has a name, which is a String, and then it has this customer method which takes a String s and you put in the name = s;. And then you…

Contents