Skip to main content


Marcin Latos
android development

Android development: droidcon ideas to get inspired by

One of your top priorities if you’re a mobile dev is staying up to date and remaining inspired by new things, even if it means challenging your beliefs. Luckily, that’s what good conferences are for. And that’s why me and Maciej headed to Berlin. The droidcon conference series doesn’t need to be introduced to anyone who’s really into Android development. Read on – for a controversial take on React Native, why Kotlin is a new standard, and why we ran into Star Wars characters.

 

Droidcon, Google and Room

We went straight to Florina Muntenescu’s session “Data persistence in Android: There’s room for improvement”. Florina works for Google, and I’ve known her from several blog entries. She talked about a new library released by Google called Room. It’s an abstract layer over SQLite that dramatically simplifies query creation. Its possibilities are amazing and oriented towards the observer pattern. Now, it’s easier to write a query using annotations.

In Room, there are 3 types of components:

  • Database – for create database holder

  • Entity – represents class and one row in database

  • DAO – component represents a  interface as a Data Access Object (DAO). Main component for define methods which access the database

Room also integrates with RxJava and the new Live Data. The library is still in the alpha phase so applying it to a production code can be a bit risky. We’re looking forward to the stable version. Florina’s presentation was very thoughtful and clear.

 

Hello Kotlin

Then, we attended “Starting from scratch in 2017” led by two guys from HERE Technologies. Stefano and Simon talked about what changed in Android architecture this year. The guys encouraged to switch to Kotlin because such transition comes at zero cost: Kotlin syntax is simple and easy to learn and Android studio has built-in converters from Java to Kotlin. They encouraged to use the MVVM (Model-View-View-Model) design pattern. This is the start of another era in Android development, or, more precisely, the development of Android application architecture. At Espeo we still use MVP (Model-View-Presenter) but it’s high time to make the switch to MVVM.

Stefano and Simon compared two new API alternatives: gRPC and GraphQL. All of them generate client-side platform-specific code automatically. There could be a license problem with GraphQL  because it has Facebook-patented features. So, gRPC has the best performance, but GraphQL provides a better organized interface to the data.

They then described persistence and cache layers, and compared libraries such as Room, DbFlow, Paper and Realm. They encouraged the use of the Repository pattern. I liked it when they showed a cool approach of treating CI (Continuous Integration) like you’d treat code. Use the Jenkins Job DSL configuration files, save it in the repo, do a code review of a new configuration and test it. On the slide below they described how they think the code writing process should look like. Every code change should go through code review and should be checked by automated testing.

android development

More Android development tips

I also went to Garima Jain’s presentation Dagger 2 Android: Defeat The Dahaka. She described the advanced use of Dagger 2 for dependency injection. Without DI, you can no longer imagine today’s applications and tests.

Xavier F. Gouchet, Android Architect at Deezer, talked about Android tests in his presentation Genetically modified tests. He presented an interesting plugin that’s used for mutation tests: gradle-pitest-plugin.

Later on we went to the presentation of Danny Preussler The Power of Kotlin For your Tests. He encouraged us to write tests in Kotlin even when the production code is written in Java. He recommended some nice libraries: Kluent or “Fluent Assertions” library written specifically for Kotlin and Kotlin Mockito.

His presentation took the form of live-coding. Danny doesn’t hide the fact that he’s fascinated by Kotlin:

kotlin

Is React Native worth it?

One of our customers was recently wondering whether to write a mobile application in React Native. To me, the answer to this question was in Andy Dyer’s presentation: React Native: Is it worth it. He described in detail how he ran his process and what sort of problems he encountered. Unfortunately, it seems that JavaScript, although very universal, has not turned out to be the perfect solution or the golden mean.

In spite of its immense popularity, React Native isn’t ideal for modern Android development. It has its good points (we’ve written about that too). However, it’s not great for sophisticated applications with complex architecture. It uses an old version of OkHttp, and as it’s the brainchild of the folks at Facebook, it uses a license that’s not fully open source. The final conclusions were not very optimistic:

react native

On the next day we got a great presentation from Hendrik KokocinskiBrave new world!? Exploring app design with architecture components and Kotlin. He talked about the next steps on the way to better Android development. The final step was the transition to Kotlin and MVVM architecture. He talked about Live Data and Room using a lot of interesting code.

If you are interested in a great ORM, then I recommend Room and Objectbox: New persistence solutions by Markus Junginger. The Greenrobot boys created a new free library called Objectbox which reached stable version 1.0 on the day of the conference. They focused on performance, they even used C ++ to improve performance and the results look impressive:

android development

Pre-conference afterword: Teslas and ‘droids

This edition was located in the trade fair part of the city, to be more precise, in CityCube. By chance, the venue also hosted IFA trade show, which we visited before droidcon. So on a sidenote, IFA was also impressive. The latest innovations in electronics were presented on an area the size of 20 football fields. We were mostly looking for cool new mobile-based stuff. Some expos were breathtaking. Couldn’t resist taking some pics. Just look at LG’s exhibit tunnel:

droidcon

There were also stars from Star Wars. Though it be better to see them ‘droids, if you get me 🙂

droidcon

We also took a peek at the exhibition of electric cars. I don’t know if you know, but Tesla has their own application as well as an unofficial API that lets you write your own Android applications and control various car functions. From what I know, you can’t control the ride itself – that would be too dangerous;-)

android development

It’s a wrap…

In conclusion, droidcon conference and Berlin – a perfect match, with so much to get your gears going. Looking at the industry, you can come to the conclusion that Kotlin is already a standard – and, perhaps, Java’s becoming passe? 😉 Similarly, MVP is being displaced by MVVM. If you’re into Android development, there’s a droidcon in Poland in December. Remember to leave a comment if there’s any Android development question that’s burning in your brain right now, because we’re all super-inspired and ready for some discussion 🙂

authors: Marcin Latos & Maciej Kozłowski

Share:Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+Pin on Pinterest

Like what you see?

Get in touch! We'll respond quickly, and we'll keep your data confidential.