kotlin Data Binding in Android

kotlin Data Binding in Android

What is Data Binding?

Data Binding is very good coding pattern for minimizing application source.here we will learn kotlin data binding in android. it gives you a facility to communicates between your view and model. It keeps code clean and sort.

Hello friends, in this tutorial I will explain Data binding android with kotlin. if you are new for kotlin then please refer post Get started with kotlin, Basics of Kotlin & Kotlin Operations

Assume that you are aware of mobile development.

let’s started with the tutorial

Kotlin Data Binding in Android

  • Create New project

Please follow step for creating a project with kotlin here.

Add Data Binding kotlin dependency in project.gradle file

In application build.gradle file apply plugin

Your build.gradle will be like

Now next step is to

  • Create Data Model

I have created DataBindingKotlinModel.kt

Use this model in your activity layout file.

  • Create Layout


  • Use Data Model In Activity

Now Use data model to bind some data with layout in your main activity


Let’s test it. run it you will get output as given below.


Next Tutorial Data Binding With Fragment >

Hope you enjoy this tutorial. If you like this post then you can share this blog.

Subscibe for more post of kotlin

2 thoughts on “kotlin Data Binding in Android

  1. I have noticed you don’t monetize your site, don’t waste your
    traffic, you can earn extra bucks every month because you’ve got high quality content.
    If you want to know how to make extra bucks, search for: Ercannou’s essential adsense alternative

  2. I have noticed you don’t monetize your website, don’t waste your traffic, you can earn extra cash every month.
    You can use the best adsense alternative for any type of website
    (they approve all websites), for more details simply search in gooogle:
    boorfe’s tips monetize your website

Leave a Comment