If I have a Firebase Firestore database which I have retrieved a DocumentSnapshot for the document corresponding to the collection on the right and stored in a
DocumentSnapshot
DocumentSnapshot has a method getString() which takes the name of a field and returns its value as a String.
String value = document.getString("username");