• Online, Self-Paced
Course Description

Defensive Programming in Android aims to use coding practices and techniques to create apps that are reliable and resilient. In this course, you will learn about thinking defensively when creating methods, and also when working with inputs to your programs.

Learning Objectives

App Input

  • start the course
  • identify common assumptions not to make about user input
  • create code that handles file inputs to an Android app
  • create code that handles URL inputs to an Android app
  • validate user-provided input
  • use a real-time approach to validating user-provided input
  • use secure coding principles to guard against format string attacks
  • parse and check input values before using that input in a WebView object
  • restrict access to navigation methods in a WebView object
  • protect against SQL injection by using parameterized and prepared statements

Methods

  • recognize best practice in writing methods for Android apps in Java
  • use best practices to name methods in Java for Android
  • use best practices to name getter methods in Java for Android
  • use best practices to name callback methods in Java for Android
  • reduce method complexity in Android apps using Java
  • use Java overloaded methods to reduce complexity in Java for Android

Constants

  • recognize how constants can be used in defensive programming
  • create and use constants in Java for Android
  • use best practices for naming constants in Java for Android
  • create and use resource files in an Android app

Conditionals

  • recognize how to write if statements defensively to protect against potential bugs
  • design while loops that are not vulnerable to running forever
  • design for loops that are not vulnerable to running forever
  • identify and avoid bugs caused by altered loop variables

Practice: Defensive Coding

  • use defensive practices to code in Java

Framework Connections