Android Studio will warn you if you are pushing changes when your code has either warnings or errors. (It won't actually stop you, if you insist that you want to push anyway.)
In general, the warnings probably aren't a big deal, but if your code has compiler errors, you'll really want to think twice about pushing that code, since if your teammates pull, then they'll have code that doesn't compile and they can't build/run/test it. (And this will probably make them grumpy with you.)
In general, it's better to commit your code every time you reach a working state.
It's also best to reach a working state frequently! That is, get a simple working version of the code going, and then add one feature at a time, testing each feature as you go.