Persist data effectively with Android Realm database

When it comes to storing application data in a database on Android, there’s not much of a choice the developer has. First of all, there is SQLite as the only officially recommended solution in Android framework. On top of SQLite, there is a number of ORM (Object-relational mapping) frameworks available which aim at allowing developer to work directly with objects when storing and reading data from a database. SQLite is however sometimes not so easy to use and there are some drawbacks due to not being designed specificaly for mobile devices. Luckily, there is another kind of database gaining on popularity lately — the Android Realm database.

Read morePersist data effectively with Android Realm database

Enable Java 8 features in Android with these libraries

Since Android N, some of the Java 8 language features are finally supported thanks to the new Jack & Jill compiler toolchain. This however comes with several limitations like for example an inability to use the new compiler along with the data binding support library or limited annotations support. But that doesn’t mean that you should give up on advanced language features of Java 8 at all. In this post, I’ll introduce you to a way how to enable Java 8 features in Android by using four libraries back-porting Java 8 functionality to lower Java versions.

Read moreEnable Java 8 features in Android with these libraries

New Date and Time API in Java 8

Handling time and date in Java has always been somewhat complicated. At least until the new Date and Time API was published along with Java 8 release. Before that, developers had to struggle with not so great java.util.Date and java.util.Calendar classes which both had their flaws. In this post, a third in a series introducing new Java 8 language features (see Java 8 Stream API and Lambda expressions tutorial posts), I’m going to present the new Date and Time API in Java 8 and explain why it’s a much better choice than previous date and time APIs.

Read moreNew Date and Time API in Java 8

Improve your code with Android Annotations support library

Annotations have been a part of Java programming language since JDK version 1.5. Since then, they have constantly gained on popularity and nowadays you probably couldn’t find a class that doesn’t use at least one annotation in its code. There is also a support library available, providing several useful annotations to be used in Android development. In this post, which is the first post of the Android Annotations series, we’ll have a look at what the annotations from Android Support library have to offer.

Read moreImprove your code with Android Annotations support library

GreenDAO: A fast Android ORM database

When it comes to persisting data on Android, the officially recommended way is to use the SQLite database. Even though the Android framework provides some kind of support in form of the helper classes, the developer still has to struggle with writing raw SQL queries and manually transforming objects to records in the database. This is where Android ORM database libraries come to give a helping hand.

Read moreGreenDAO: A fast Android ORM database

Lambda expressions in Android (part 2/2)

In the previous post, lambda expressions in Java 8 have been introduced. In this post I will describe how to enable and use Java 8 language features including lambda expressions in Android development.

Until recently, only Java 7 was officially supported when developing for Android. However, this changes with the release of Android N (Nougat, API version 24) and its official support for Java 8. Before Android N was released however, it was also possible to use an external library called retrolambda which allows to bring lambda expressions support to Java 7 and lower.

Read moreLambda expressions in Android (part 2/2)

Lambda expressions in Java 8 (part 1/2)

Java 8 brought many new features known up until now mainly from functional programming languages. Among the most interesting ones, there are lambda expressions, default methods, stream API, etc. In this post, let me introduce you to the first of listed — lambda expressions.

Read moreLambda expressions in Java 8 (part 1/2)