Tag: testing
-
Android Architecture Components – Looking at Room and LiveData – Part 1
This week at Google I/O 2017, there were a lot of new announcements for the Android Platform. One of the announcements was the new architecture guidelines for Android! This is a welcome addition to the Android platform. Previously the Android team refrained from giving advice as to how you should structure your Android applications. For…
-
Introduction to Automated Android Testing – Part 6
In the previous 5 blog posts, we covered different aspects of building an Android app from scratch. We focused on including tests in the process. Here are the links to the previous posts: Post #1 – Why should we write tests? Post #2 – Set up your app for testing Post #3 – Creating API…
-
Introduction to Automated Android Testing – Part 5
In this series of blog posts, we are working through a sample app called Github User Search. Parts 1 – 4 covered why we should test, getting set up with testing, creating API calls and creating a presenter. Take a look at the previous posts as part 5 is a continuation of the series. In part…
-
Introduction to Automated Android Testing – Part 4
In this blog post series, we are working through an example Android app called Github User Search. In the previous blog posts, we took a look at setting up your app for testing, creating API calls and writing the first basic test for the API transformations. Read part 1, part 2 and part 3 first.
-
Introduction to Automated Android Testing – Part 1
I’ve seen a lot of people confused and unsure about how to do tests in Android. In the past, it was very difficult to test Android apps and there wasn’t much direction. In this series, I am going to try make testing a bit easier for you. This first post is just to get you started with…
-
Automated Testing of SQLite Database Upgrades – Android
As a follow up to my previous post [How to use onUpgrade() correctly in Android], I decided that I should probably add some tests to avoid database upgrade failures in the future. Manually testing database upgrades in Android can be quite a pain and you are bound to miss something, especially if you have had loads of versions…
-
Retrofit 2 – Mocking HTTP Responses
In the previous post, I discussed implementing a custom Retrofit Client to mock out different HTTP response codes. This mechanism works well for Retrofit versions 1.9 and below but has its drawbacks. After trying out Retrofit 2, I have adjusted the previous sample and managed to achieve the same results (with some improvements 😀).
-
Mocking API Responses using a Retrofit Client in Android (Retrofit 1.9)
Writing test cases in Android can be quite a daunting task, especially the handling of different server responses. Testing error responses can be quite problematic and your app might not cover all the different scenarios. If you are using Retrofit 1.9 and below to do your network calls, testing error responses can be quite simple. There…