Category Archives: Kotlin

Everything about Kotlin

BMI Calculator – Room

In this chapter of the BMI Calculator application we are going to integrate Room, what is a persistent library. Using Room we can store the saved BMIs in SQL database and when we open the app, then they gonna be listed in the BmisFragment.

So, what we are going to do in this chapter is first to annotate the BMI data class, then we gonna create the DAO and the database. Thenafter we will start inserting the BMIs into the database, and finally get them back at startup of the app.

So, let’s start coding. 😎

Continue reading

Follow and like us:

BMI Calculator – Data Binding Adapter

In this chapter of the BMI Calculator application we are going to add to the layouts custom attributes using Data Binding Adapter.

With Data Binding Adapter we will create for the result_fragment.xml custom attributes to show in text form a short evaluation of the result BMI value. Then for this text, we gonna define some conditions to change its color. The result will look like below.

Underweight
Healthy
Overweight
Obese

Continue reading

Follow and like us: