Android Related Articles

Posts in 2018
  • No sleeping during testing RxJava app!

    Monday, November 26, 2018 in Android

    Featured Image for No sleeping during testing RxJava app!
    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)) …

    Read more

  • Solve your problems with time during Android Integration test

    Tuesday, November 06, 2018 in Android

    Featured Image for Solve your problems with time during Android Integration test
    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 …

    Read more

  • Using schedulers while testing your code

    Tuesday, February 27, 2018 in Android

    Featured Image for Using schedulers while testing your code
    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 …

    Read more

  • Errors... oh... those errors - coding

    Tuesday, February 27, 2018 in Android

    Featured Image for Errors... oh... those errors - coding
    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. …

    Read more

  • How to find StackOverflowError's

    Wednesday, February 07, 2018 in Android

    Featured Image for How to find StackOverflowError's
    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 …

    Read more

  • A nice reader/writer pattern

    Monday, January 15, 2018 in Android

    Featured Image for A nice reader/writer pattern
    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 = …

    Read more

  • Kotlin and RxJava with extension functions

    Sunday, January 07, 2018 in Android

    Featured Image for Kotlin and RxJava with extension functions
    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 …

    Read more