What's new in Android? Google I/O 2019 from developer perspective
Third post with Google I/O recap. Time for Android developer perspective.
Third post with Google I/O recap. Time for Android developer perspective.
Second post with Google I/O recap. Time for changes in Android Q - staying with 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.
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()
?
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.
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).
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.
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?
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.
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!
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?
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.
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.
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.
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.
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.
Some time ago Android team finally introduced GrantPermissionRule
. How does it work with KotlinTest? It doesn’t, but it’s not a big deal.
Previous article was talking about new stuff in Android from developer perspective, it’s time for user’s point of view.
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.
This is quick and short update on state of Kotlin-targeted testing frameworks.
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.
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.
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.
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.
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.
jEnv is the tool for quick and easy management of you java versions. Which is pretty cool.
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!
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.
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…
New Year has come. I’m not a fan of new year’s resolutions, but let’s try.
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!
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?
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.
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?!?!?!?!?!?
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.
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.
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”
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?
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.
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
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.
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.
What’s a better idea for a first real post than a post about primes?
Yep, it’s the first post and small introduction of all whys and whats.