Tag Archives: Coroutines

BMI Calculator – Testing

In this lecture of the BMI Calculator sample application we are going to talk first about how does testing works on Android.

You will learn about the following topics:

      • Setup and run tests
        • Unit tests
        • Instrumented tests
      • Some code concepts
        • JUnit4
        • Hamcrest
        • AndroidX test library
        • AndroidX Architecture Components Core Test Library

Continue reading

Follow and like us:

BMI Calculator – RecyclerView

In this chapter of the BMI Calculator application tutorial we are going to start using the RecyclerView, what we have already added to the bmis_fragment.xml file.

In this chapter first, we will create an Adapter and a ViewHolder, which won’t have a difficult layout. Thenafter we will create a Data Binding Adapter, which will send the items for the RecyclerView.

Continue reading

Follow and like us:

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: