How do I implement a basic user credentials authentication?

so here's my situation. I'm trying to build a very basic app on Android Studio that requires a sign in and a registration page. Both pages prompt the user to insert their username and password. What I want to happen next is that when a user goes to the registration page and inserts a username, I want the program to check if it's unique or not. If it is, I want the program to essentially store the registration data for future use. So when a user wants to sign in, they can only sign in using a registered username, and they can only access the account if it's accompanied by the right password. I tried looking up tutorials online, but I couldn't find anything that fits what I'm looking for. Any ideas?Tips? Tutorials? Pointers? All would be greatly appreciated.