how to use variable in android studio code example
Example 1: how to declare variable in android
I suggest learning Java fundamentals first. Declaring a variable is fundamental to Java programming language (and indeed many programming languages), its not just Android specific.
You can learn Java fundamentals here.
Good Luck in your learning
Example 2: how to declare variable in android
var1 = 'variable1';
var2 = 'variable2';