

Note: If you do not see Developer options, follow the instructions to Then enable USB debugging (if applicable). On the device, open the Settings app, select Developer options, and The device to using a USB cable or Wi-Fi.

Set up a device for developmentīefore you can start debugging on your device, decide if you want to connect To run your app on a wide variety of real devices hosted in aĬloud-based infrastructure. Note: Use the Android emulator to test your app onĭifferent versions of the Android platform and different screen sizes. Your development environment and Android device for testing and debugging overĪn Android Debug Bridge (ADB) connection. LogIn just calls to the Firebase class FirebaseAuth using the method signInWithEmailAndPassword.When building an Android app, it's important that you always test your app onĪ real device before releasing it to users. LogInModel has a function LogIn(email, password) which we want to test. You have a wrapper class around Firebase (best practice in case you change your back end later down the line) called LogInModel. Let’s say you have a CRUD app with sign-in functionality. I’m going to show how to mock Firebase using an example scenario. In this blog, I’m going to show you how you can use Mockito to mock different Firebase functions and perform local unit testing. With this method you simply get to use Firebase as you normally would - just on a different database to ensure that you don’t mess up anything in production.īut what if you didn’t want to use a non-production database? Either you’re a single developer who doesn’t want to maintain two databases, or you’re without internet access a lot of the time? The Firebase line on testing is the common solution is to use a non-production database and perform the actual read and write actions against that database to make sure everything works ( Firebase Documentation). With TDD in mind, you will likely want to test out your methods that use Firebase to ensure everything is working properly.

Firebase has native integration with Android Studio and is very easy to set up if you have no backend experience making it an excellent choice for beginners and experienced programmers alike. If the app is going to have any sort of CRUD functionality a good choice of backend is Firebase.

If you’re looking to develop an Android app using Kotlin its best to keep TDD in mind because it will allow your application to be broken down into separable testable components - making developing tests easier and finding bugs in your application easier. Modern mobile programming practices, and programming practices at large, place a great deal of emphasis on test-driven development.
