But I think with the Firebase DB I can't just use a password .I need username and password.
I think the easiest way to authenticate a user would be by tapping into their Google account:
https://developers.google.com/identity/sign-in/android/sign-in. If you want to roll your own (which I wouldn't recommend), you could write a REST web service that handles authentication. That way it wouldn't matter what kind of DB is used.
also, I noticed in this App the password will be working only on one device.I think the developer get IMEI number from the device that installs the App to prevent use the password with the different device, Is this against Google policy to get the IMEI and save it to chek later?
Why do you want the password to work on a single device only, rather than for a single user? These days everyone has multiple devices, and being able to use just a single one would be an inconvenience that users will neither expect nor like.