In Android, the user interface is built using a hierarchy of View and ViewGroup objects. Views are basic UI elements like buttons and text fields, while ViewGroups serve as containers to hold other views and arrange their layout. The UI hierarchy is defined using XML layout files, which map XML elements to their corresponding View classes. These layout files are loaded and inflated into views at runtime. Views can also be created and added programmatically in code. Views handle drawing, interaction events, and other behaviors to display the UI to the user.