A computer is a machine that follows a list of instructions called a program. An Android device is a computer and an app is a program.
A variable is a container in an Android device that holds a value such as a number or a piece of text. These are but two of the many possible types of variables. The contents of a variable can be changed by the device as the app runs. That’s why they’re called “variables.”
Each variable has a name such as “currentScore”, “restaurantName”, or “textView”. Since the variable name is a word that we invented, and that the device has never seen before, we have to write an instruction in the app to tell the device that the word is intended to be the name of a variable, and what type of variable it is. This instruction is called a variable declaration. It creates the variable and makes it possible to mention the name of the variable in the following instructions of the app. The illustration shows a declaration for a variable named “textView”.