DO YOU EVEN CODE, BRO? Blog of Software developer Yes, I code and write. And explain things in a simple manner

What's new in Android? Google I/O 2019 from developer perspective

Third post with Google I/O recap. Time for Android developer perspective.

What's new in Android? Google I/O 2019 from developer perspective feature image
Read more...

What's new in Android Q? Google I/O 2019 from user perspective

Second post with Google I/O recap. Time for changes in Android Q - staying with user perspective.

What's new in Android Q? Google I/O 2019 from user perspective feature image
Read more...

What's new? Google I/O 2019 from user perspective

Time for my first yearly post series! As last year, I want to do recap of Google I/O from both perspectives: user and developer. Let’s start with user.

What's new? Google I/O 2019 from user perspective feature image
Read more...

Android testing with Espresso - simple way to wait for activity to be visible

Have you ever done some testing using Espresso and was baffled that you need to manually wait for some UI elements to be visible? I thought testing is so simple, you just tell what to click and what should appear. Brutal reality kicks in and you try to make it easy using IdlingResource, which makes it overly complicated.

Testing on Android gets better - there is no denying this. But at the same time, sometimes it is lacking so many basic functionalities, that it hurts. Clear app data between tests? Wait for view or activity to be visible without Thread.sleep()?

Android testing with Espresso - simple way to wait for activity to be visible feature image
Read more...

Fixing movies 'created' time - EXIF and MacOS metadata

In previous article I wrote about fixing ‘created’ metadata for images but there is one topic I didn’t finish there - fixing metadata for movies (see problem number 3 there). I didn’t finish it, because it wasn’t as simple as two ther commands. Or it was, but I chose different way.

Fixing movies 'created' time - EXIF and MacOS metadata feature image
Read more...

How to fix time/date of your photos on mac

If you have Android phone and you’ve ever copied photos from the phone to your mac - you probably know the pain. Created date and time of photos is totally wrong! I was doing weird things to fix that and I’ve finally found simple way. Here it is (spoiler alert: ExifTool).

How to fix time/date of your photos on mac feature image
Read more...

Writing good article is like writing good code - pragmatic approach

I don’t know about you but the older I get, the more things become similar. And I don’t mean it in a way “I’ve seen enough so nothing surprises me anymore”, but “I think I’ve seen it before… apparently a lot of approaches are really universal”. This time let’s approach similarity of writing good code and good article.

Writing good article is like writing good code - pragmatic approach feature image
Read more...

Kotlin: the case for extension functions

Extension functions, again. I feel this is one of the most unexplored topics of Kotlin (but I’m trying!). There are barely any standards for using them, but here I want to focus on one thing - should we choose extension functions over standalone functions?

Kotlin: the case for extension functions feature image
Read more...

There is nothing like the best tool

Every post claiming that some tool, some language, some something is the best thing is… lying to you. Sad, but true. Best for who? Best in what application? Best in which context? Best if what? The topic deserves a quick post.

There is nothing like the best tool feature image
Read more...

Future of error handling in Kotlin

If you want to read something that will be applicable in the real world right away - this post has no use for you. But if you want to see what future of error/exception handling in Kotlin might look like - grab your crystal ball and join me!

Future of error handling in Kotlin feature image
Read more...

Exceptions handling in Kotlin - are you doing it right?

In previous post I wrote about SuccessOrFailure and how it (usually) should not be used for exception handling. But the question remains: if I want to be good programmer, how should I handle errors if something as cool as SuccessOrFailure is “forbidden”? Fortunately, in SuccessOrFailure’s KEEP and corresponding discussion, Roman Elizarov explains how he sees exception handling. Is there anyone better to tell us how to handle exceptions in Kotlin other than Kotlin libraries team lead?

Exceptions handling in Kotlin - are you doing it right? feature image
Read more...

Kotlin 1.3-M1 SuccessOrFailure - success or failure?

If you don’t get the title - don’t worry, you will. 1.3-M1 and even 1.3-M2 version of Kotlin was released and it contains pretty sweet changes. Ok, a few pretty sweet changes and a few that are either not groundbreaking or weird. The weird one is SuccessOrFailure. I read a lot about it and this post sums it up along with my thoughts.

Kotlin 1.3-M1 SuccessOrFailure - success or failure? feature image
Read more...

Quick tip: make MockWebServer return default response

MockWebServer from guys from Square is awesome and I use it on the daily basis. But there is one thing that would seem pretty obvious - MockWebServer returns default response, right? So you don’t need to mock EVERYTHING, right? Well, not. But I found pretty easy fix.

Quick tip: make MockWebServer return default response feature image
Read more...

The simplest way to make RxJava synchronous (on Android)

In life of every programmer comes time to test that code. This moment is especially hard with new concepts or even paradigms. Good example here is RxJava - you can do magic with it, but testing magic is not so trivial. So, here comes the most important thing: how to make all RxJava chains synchronous.

The simplest way to make RxJava synchronous (on Android) feature image
Read more...

Android P - CLEARTEXT communication not permitted by network security policy

What? Android P blocks HTTP without S? Who cares, I use only HTTPS anyway, because I am secure. Yep, I thought the same, until I got this exception myself. Because testing.

Android P - CLEARTEXT communication not permitted by network security policy feature image Photo Credit: What's new in Android security (Google I/O '18)
Read more...

The hidden cost of NOT using new technologies

Let’s get straight: this is not yet another post about “if you are not moving forward, you are going back”. We all know that by know, right? This is about companies trying new things and why that might be financially beneficial.

The hidden cost of NOT using new technologies feature image
Read more...

GrantPermissionRule without @Rule

Some time ago Android team finally introduced GrantPermissionRule. How does it work with KotlinTest? It doesn’t, but it’s not a big deal.

GrantPermissionRule without @Rule feature image
Read more...

What's new in Android? Google I/O 2018 from user perspective

Previous article was talking about new stuff in Android from developer perspective, it’s time for user’s point of view.

What's new in Android? Google I/O 2018 from user perspective feature image
Read more...

What's new in Android? Google I/O from developer perspective

It’s been a month since Google I/O 2018 took place. I finally managed to watch some presentations, read about it and try some new stuff. Android Work Manager that I’ve written about is pretty cool. But there is so much more in Android from Google I/O and previous months, it’s time to organise it into one post.

What's new in Android? Google I/O from developer perspective feature image
Read more...

Kotlin testing frameworks - revisited

This is quick and short update on state of Kotlin-targeted testing frameworks.

Kotlin testing frameworks - revisited feature image
Read more...

KotlinTest 3.0 - yep, it works

Two months ago new version of KotlinTest was released - brand new shiny 3.0. Even logo is new! There were some issues with previous version that I described in The best testing framework for Kotlin. Let’s give it another try.

KotlinTest 3.0 - yep, it works feature image
Read more...

Android WorkManager - one scheduler to rule them all!

With latest Google I/O came a few changes to Android. All of this deserves separate write-up but for now let’s focus on one cool thing - WorkManager.

Android WorkManager - one scheduler to rule them all! feature image
Read more...

How to NOT fight for women rights in tech

Finally some controversial topic on this blog! Women in tech. Hot topic and misunderstood by many (not that I’m an expert here). It deservers separate article but this time I want to look into bad case of fighting for equal rights.

How to NOT fight for women rights in tech feature image
Read more...

Best NoSQL database for Android

In the previous post I discussed WHY would you like to use NoSQL database on Android. Now it’s time to discuss what possibilities there are for Android platform.

Best NoSQL database for Android feature image
Read more...

When to use NoSQL on Android? NoSQL vs SQL comparison

You have to store data on Android. What do you do? Typical scenario is using SQLite or some kind of ORM. But that shouldn’t always be the case.

When to use NoSQL on Android? NoSQL vs SQL comparison feature image
Read more...

Want to try Java 9? jEnv is your solution

jEnv is the tool for quick and easy management of you java versions. Which is pretty cool.

Want to try Java 9? jEnv is your solution feature image
Read more...

What is recursion?

Recursion is simple if you’ve been programming for a while but for someone just starting, this concept might be hard to comprehend. But fear not!

What is recursion? feature image
Read more...

The best testing framework for Kotlin

With every new language or even new environment there comes time to ask yourself very important question: How will I test that? Kotlin itselft is just awesome. But state of its test frameworks is just not awesome.

The best testing framework for Kotlin feature image
Read more...

EmbeddedKafka rage aka quick fix for ClassNotFoundException and IOException

Did you have these exceptions? ClassNotFoundException: org.apache.kafka.common.security.auth.SecurityProtocol IOException: No JAAS configuration section named 'Server' was foundin 'gss.conf' Then I feel your pain…

EmbeddedKafka rage aka quick fix for ClassNotFoundException and IOException feature image
Read more...

Happy New Year! And happy new year's resolutions!

New Year has come. I’m not a fan of new year’s resolutions, but let’s try.

Happy New Year! And happy new year's resolutions! feature image
Read more...

Make Kafka great (concurrent) again!

You set up Kafka, everything works. It’s time to make it REALLY work. Kafka is made to handle huge load of data, but good luck with that if you have a single thread. So let’s make it multithreaded!

Make Kafka great (concurrent) again! feature image
Read more...

Making Spring Kafka work WITHOUT annotations

Post pic - get it? Because he is Franz Kafka!

Lame jokes aside, we’ve already talked about Kafka testing and why I don’t like annotations. So let’s combine those two things and talk about how to make “Spring for Apache Kafka” work but without annotations?

Making Spring Kafka work WITHOUT annotations feature image
Read more...

Why I don't like annotations

If you do enterprise systems, you probably know annotations all too well. For me they are one of the things that are wrong with enterprise.

Why I don't like annotations feature image
Read more...

Testing asynchronous code with Spock

Alternative title: What’s wrong with Spock?

There are some times when simple things just strike you and you have really no idea what’s wrong. This was one of these times. HOW ON EARTH CAN I CHECK IF SOME METHOD WAS CALLED ASYNCHRONOUSLY IN SPOCK?!?!?!?!?!?

Testing asynchronous code with Spock feature image
Read more...

Functional tests with Spring Kafka can be painful

Documentation for spring-kafka-test is not the best. It’s not the worst neither, but sometimes it can be quite painful to use EmbeddedKafkaServer. More test samples would come handy, because I wasted so much time with simple test that should just work.

Functional tests with Spring Kafka can be painful feature image
Read more...

When extension methods are too much...

If you know Kotlin, or at least you have heard something about Kotlin, you know extension methods. But one important question with extension methods is how to use it, while not abusing it? I present you: one concrete example for abuse.

When extension methods are too much... feature image
Read more...

Are magic strings/numbers always bad?

If you know the Betteridge’s law of headlines, you know that the answer is no. I discussed it many times with my colleagues and it’s time to define rules for what constitutes as “magic string/number”

Are magic strings/numbers always bad? feature image
Read more...

Checked vs unchecked exceptions

This was a day at work like any other. I was refactoring code and suddenly noticed that at one point we were too optimistic about the code and there is NullPointerException waiting to happen. But based on this object we had to return some data, soooo… let’s throw an exception?

Checked vs unchecked exceptions feature image
Read more...

You too can become Android Expert!

Recently I’m definitely more into talks/presentation that are not very one-technology-oriented. Technologies come and go, but foundation is what counts. And good example of such talk is Chiu-Ki Chan - How to be an Android Expert from DroidCon in Berlin.

You too can become Android Expert! feature image
Read more...

Mockito in Android instrumented test

Wow. These tests are greeeen. You are rocking JUnit and Mockito like nobody’s business. You unit tested the shit out of your code - Uncle Bob would be proud. And it’s time to do more functional testing, so you do Android instrumented test. And then… BAM

org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: interface com.douevencode.Sample

Mockito in Android instrumented test feature image
Read more...

Material Chips list on Android with ChipsLayoutManager

In previous post I listed material chips libraries and said that I went with BelooS/ChipsLayoutManager. It’s time to tell you why and how.

Material Chips list on Android with ChipsLayoutManager feature image
Read more...

Best Material Design Chips Library

Warning! My final choice i.e. BelooS/ChipsLayoutManager is no longer maintained so I can’t recommend it anymore.

‘Chips’ is not widely known design element for Android, but I think it looks cool and can be very useful. Unfortunately, there is no built-in solution to do it, so I wanted to find some library that would help me with that.

Best Material Design Chips Library feature image Photo Credit: Material guidelines
Read more...

Primer on primes

What’s a better idea for a first real post than a post about primes?

Primer on primes feature image
Read more...

Hello World!

Yep, it’s the first post and small introduction of all whys and whats.

Hello World! feature image
Read more...