Even though UX and UI are often used interchangeably, they're not synonymous.
UX stands for user experience. All the code you write contributes to the user experience, whether it's UI code (such as the XML that creates a button and places it on the screen) or non-visual code, such as the code for remembering the user's address and using it to auto-fill all the forms throughout your app.
Non-visual and visual code come together to deliver your app's user experience, but if looked at in isolation, visual code only delivers your app's UI.
Tip
Market Research
Throughout this chapter, I'll be encouraging you to examine how other apps deliver an effective UI and UX. But as a general rule, if you ever find yourself struggling to overcome a particular design problem, it may help to flick through a few of the Android apps that you have installed on your smartphone or tablet to see how they tackle similar design challenges. If you're struggling for general inspiration...