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. An app contains objects of many classes such as class TextView and class ImageView.
Two people can share the same name — Bill Clinton and Bill Gates — because they belong to different families. Two classes can share the same name—widget.TextView and thirdParty.TextView — because they belong to different packages.
A package is a set of classes. Think of it as a family providing the classes with a common last name, which is the name of the package itself.
In English, we write the family name to the right of the first name, and separate it with a space: Bill Clinton In the language Java, we write the package name to the left and separate it with a dot: widget.TextView
A package can belong to a bigger package. For example, class TextView belongs to a package named widget, which belongs to a bigger package named android. The full name, or fully qualified name, of class TextView is therefore android.widget.TextView and this fully qualified name must be written in the import statement near the top of every Java file that mentions the class.
Each app has a package that contains the classes created in that app. The name of the app’s package is composed of the name of your organization followed by the name of the app, all in lowercase, and is announced in the package statement at the top of each Java file:
When your app creates a class named MainActivity, its fully qualified name is therefore com.mycompany.myapp.MainActivity