• Anniversaries

    This week I’m celebrating two anniversaries:

    • this blog became three years old,
    • and I quit smoking one year ago totally.
  • Narrow your focus during testing

    Recently, I wrote the first UI test for an Android app. The first one is often way longer than the others, as you need to set up many things which can be reused later. The infinite amount of time required is especially true if you overcomplicate the test case and want to test too many things in the first simple run, as I did. Let me show you how.

  • Fairphone 4 - the new sustainable candidate

    OnePlus 3T - the past

    I used a OnePlus 3T for 5 years and 3 months (1907 days in total). It was a great device, but once I couldn’t answer phone calls I knew: it was time to replace it.

  • Type alias used to simplify future refactors

    I had to introduce a new model in one of my projects, and by that time, I wasn’t sure about its type (Int or String). I had to start the implementation to meet the deadline, so I choose to hide the type somehow. Kotlin’s type aliases came to help me.

    typealias Key = Int
  • Let the Dependency Injection work for you

    Recently I received a comment on a code review pointing on this line in one of my ViewModels:

    context.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager

    My colleague suggested refactoring it, that the Dependency Injection framework should provide the proper system service for me.

  • How to accelerate your input

    As a software engineer, it’s crucial how quick you can translate your thoughts into machine-readable code. Nowadays, it’s obvious that we’re using a keyboard and some pointer (mouse or touchpad) as inputs for a computer. However, new ways are approaching (like voice typing, etc.), but I’d focus on the keyboard right now.

    Why keyboard only?

    The answer is super easy: it’s a time loss to use the mouse. You need to move your hand away from the keyboard, clicking on some objects, which takes a lot of your precious time.

  • The importance of unit testing

    Are you writing code in TDD? I guess not.

    But we all know unit testing can easily catch issues, and they’re incredibly cheap in terms of resources, especially time.

    I’ll show you a case of how.

  • Compare files with diff command

    Recently I sent a text file to a colleague, and I received it back with a few, almost viewless changes. I was looking for something that can compare the two files and help me understand the differences.

    A quick search and an article gave me the solution:

    The diff command.

  • Coding in Kotlin, like speaking in English

    I’ve been using Kotlin for 2,5 years now, but it still amazes me how naturally this superb language allows me to write code.

    Regularly I try to solve simple issues with writing the words into the IDE like into a chat. After typing a few characters (writ for example), I’ll pick a suitable writeThisBlogPost() method from the suggestion list.

    Sometimes such a method does not exist, and I have to write my own implementation for that, but Kotlin’s interface is so cool, that often it is already there for me.

  • Config files migrated to git

    Recently I started to use another laptop for development, and I wanted to keep my configs in sync between all my devices.

    I wanted to sync:

    • .bash_aliases
    • .bashrc
    • .gitconfig
    • .ideavimrc
    • .vimrc
    • .zshrc

    Previously I was creating backup irregularly into my cloud storage, but I read an article about adding all these files into a git repository, which I found an interesting idea.

  • Change default JDK to Android Studio's bundled JDK

    Recently I was looking for a solution to reduce a bit the enormous amount of RAM consumed by Android Studio and Gradle.

    During a meetup of the Kotlin Budapest User Group I received a suggestion to change my default JDK to Android Studio’s JDK and this link for help.

  • Duplicate label in when

    Maybe you already encountered the warning above if you’re using Kotlin, and copy-paste often.

  • Sustainability contribution as an Android Engineer

    Did you ever wonder how can you as an individual help build a sustainable world? With my fiancée, we’re constantly improving our way of life to produce less waste, and reduce our footprint on Earth.

    The main focus of ours is the decrease in consumption. For example, I’m using a OnePlus 3T for 3,5 years, and my girlfriend has an iPhone 5S…

    Thinking about old phones it came to my mind, that finally, I found a field in my professional life I definitely can contribute to the waste-reducing goal: I have to create apps that are running on old devices too.

  • How to avoid Android DataBinding NPE related crashes

    During investigating and fixing a crash in one of the apps I’m contributing, I found an issue with DataBinding and custom adapters I’d like to share with you.

  • Home office setup

    Given that we should prepare ourselves for a quite long home office run I dig deep into my - almost forgotten - carton box, which contains a lot of cables, webcams, spare keyboards and mouses, etc. to create a reasonable setup for working from home.

    The basic idea was, that as I have a Bluetooth keyboard and mouse too (which I was using in the office in general) I should use them to connect both my laptop and PC and control them with the same input sources. I wanted to create such a setup where hitting a few buttons can help me to switch between those 2 devices wireless, without the need to disconnect/reconnect USB and HDMI cables.

  • 10 thoughts of mine about Android Data Binding

    I’ve been using the Data Binding for Android for 1 year, and I found it’s a pretty handy tool for us to wire up xml layouts, Fragments, and our ViewModels. However, I’ve been facing some issues during day-to-day usage I want to share with you.

  • Sit/stand added to my setup

    I was so joyful today morning seeing the first snow of the winter. The whole city was white, and especially the inner court of the office building was amazingly snowy.

    But there was one more shiny white surprise today: finally, I received my new sit/stand desk from Ikea.

  • Fixing bluetooth mouse lag on Ubuntu

    Friday morning, you are sitting on a train heading to Praha, building some xml layouts for a new screen of the app you’re working on right now.

    Meantime your fiancée is a bit sad because she left her mouse at home.

    The solution is pretty easy, as you are using the keyboard for almost everything: you will lend her your Logitech G603 Bluetooth mouse.

    Steps to reproduce the story:

    1. Switch on the mouse
    2. Open its panel in the Bluetooth settings
    3. Click Remove Device
    4. Disaster
  • Join lines in Android Studio

    A warm welcome to you, who are reading the first post here, on my brand new blog.

    In the previous days I was wondering what could be the best content for the first post in a blog, where I want to share my moments with Linux, Android, etc. Considering these requirements: it should be something deep technical and for sure a long one!

    Mean time Android Studio just made me smile today while I was using a keybinding I found recently.

subscribe via RSS