Android Related Articles
-
No sleeping during testing RxJava app!
Monday, November 26, 2018 in Android
Image from [unsplash](https://unsplash.com/) During development of Android tests you’ve written something like this: @Test fun afterStartActivity_verifyIfDataIsDisplayedFromTheServer() { activityRule.launchActivity() Thread.sleep(5000L) // 5 seconds onView(withId(R.id.main_activity_text)) …
-
Solve your problems with time during Android Integration test
Tuesday, November 06, 2018 in Android
Image from [unsplash](https://unsplash.com/photos/iiRQxPCDQ_Y) TL;DR; You can simply fake/adjust current time and locales via TimeTravelRule, LocaleTestRule rules. For a usage look here: MainActivityTest. Example Let’s implement very simple UI that displays the current time as a text view. In …
-
Using schedulers while testing your code
Tuesday, February 27, 2018 in Android
Image from [unsplash](https://unsplash.com/) Let’s start with an example We would like to implement UI that sends a post to a server. Our UI needs a text field for typing a message and a button for sending it to the server. Of course, the UI displays error/success messages (via toast). We …
-
Errors... oh... those errors - coding
Tuesday, February 27, 2018 in Android
Image from [Unsplash](https://unsplash.com) If you haven’t read Errors… oh… those errors, please read it first Main objectives: Almost 0 code to use, Customizable, Extendable. TL;DR: The full exemplary code is available here. Idea The idea of error messages is quite simple. …
-
How to find StackOverflowError's
Wednesday, February 07, 2018 in Android
Image from [unsplash](https://unsplash.com/) Description. Usually, StackOverflowError appears unexpectedly and sometimes it’s hard to trace it just with a stack trace. On Android, different devices have different stack sizes depending on the API level or even manufacturer. So the right …
-
A nice reader/writer pattern
Monday, January 15, 2018 in Android
Photo by [Patrick Lindenberg](https://unsplash.com/@heapdump) on [Unsplash](https://unsplash.com/photos/1iVKwElWrPA) TL;DR; An example of good practice: NewDatabaseTest NewDatabase Compared to an example of bad practice:: OldDatabaseTest OldDatabase Example Let’s start with a database which looks like this: class OldDatabase { val readWriteLock = …
-
Kotlin and RxJava with extension functions
Sunday, January 07, 2018 in Android
Image from [unsplash](https://unsplash.com/photos/L94dWXNKwrY) Warning: Lots of codes. Since it’s relatively a technical article and I am an Android dev (probably as you are), there will be a lot of code examples. TL;DR; The full code is available here Used libraries TIP: In the example, I use RxJava 1.x …