Data Binding -- Write Apps Faster (Android Dev Summit 2015)

Published on Nov 24, 2015 68,770 views

Android Data Binding, introduced at Google I/O as a preview, allows developers to write applications faster, easier, with fewer bugs, and with no performance impact. By adding a binding expression to your layout XML, you can tie the data model back end to your UI. George Mount & Yigit Boyar discuss how this is done and some of the magic that is happening behind the scenes to make this possible.

Watch more talks from Android Dev Summit 2015 here: https://goo.gl/Gt9K97

Subscribe to the Android Developers channel at http://goo.gl/GEh1ds

Music by Terra Monk: https://www.terramonk.com

#androiddevsummit2015 #databinding

  • Said Tahsin Dane
    Said Tahsin Dane 3 года назад He says at 19:38 that "Dont try to do business logic through XML" but just after that he shows very simple code where the drawable changes based on user's age. Although it is really simple, I think it is a business logic. I am confused.
  • Guangkai Ren
    Guangkai Ren 4 месяца назад @Pedro Varela That's boring and lengthy stuff. I doubt if you really read it over.
  • Interprone
    Interprone Год назад That's not business logic. It's presentation logic. The UI decides to present the business information (user.age) in a certain way. The code would have been cleaner if we indeed had an isOfAge method as suggested by Brendan, as long as that method stays "semantic" and doesn't determine the drawable - the actual drawable used is presentation logic.
  • Pedro Varela
    Pedro Varela 3 года назад +Brendan Arnold exactly
  • Brendan Arnold
    Brendan Arnold 3 года назад Yeah it's not a great example - really there should be a bool value 'isOfAge' which determines the drawable since the 18 threshold is business logic (i.e. decided by another department in the organisation). However the XML logic is really useful for stuff like fuzzy times e.g. less than 'a minute ago', '2 minutes ago', 'yesterday', 'last week' etc. which are UI/UX design decisions.
  • Pedro Varela
    Pedro Varela 3 года назад It is not that "doing business logic in xml" that logic, could be as simple as checking a variable to certain data and change the drawable depending on it. I learned data binding in Flex. Check this out so you get and idea http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64c3d-7fff.html..
  • B Wally
    B Wally 6 дней назад 17: 19 When use instance adapter ! if i can some use cases it will be fun.
  • Budi Raharja
    Budi Raharja 3 года назад Wah, very helpful! :)
  • Chloroform Cowboy
    Chloroform Cowboy 3 года назад At first I didn't leave a comment, because it's possible the presenters are actually reading these, and I'm very sympathetic to others, but it must be said that objectively: this video was painful to watch. I stopped midway and resolved that if I ever cared enough, I would just resort to the docs on data-binding. Don't give up, though, George. Public speaking is a skill (and notably it's not correlated to how objectively interesting or intelligent someone is. Some of the smartest people suck at presenting and some of the dumbest people excel at presenting those same smart people's ideas, so it's nothing to be offended by.) Practice makes perfect; really. Cheers.
  • sygnuus
    sygnuus 2 года назад j7p
  • Lejia Chen
    Lejia Chen 3 года назад I like this talk and this talk makes me laugh sometimes. I hope presenters not so upset when see those comments.
  • Anthony Bernardo
    Anthony Bernardo 3 года назад I love it!
  • kratosonator
    kratosonator 3 года назад Did anyone try to use Observable interface to notify UI about the updates? PropertyChangeRegistry doesn't have notifyPropertyChanged() method.
  • Alberto Polo
    Alberto Polo 3 года назад Pretty awesome.
  • Ricky Solorio
    Ricky Solorio Год назад Binding Adapters @13:46
  • Miguel
    Miguel 2 года назад Error:Data Binding does not support Jack builds yet :(
  • Tomasz Rykała
    Tomasz Rykała 3 года назад Excellent demo and explanation.
  • Alex Timonin
    Alex Timonin 3 года назад These guys rock!
  • Marcin Ukryty
    Marcin Ukryty 3 года назад ylk
  • Ameen Maheen
    Ameen Maheen 3 года назад Cool stuff
  • Michael Liu
    Michael Liu 3 года назад Great, make code clean
  • Xun
    Xun Год назад What do you think of AndroidAnnotation?
  • Moumene louifi
    Moumene louifi 3 года назад is this binding restricted to new version of Android devices ? any backward compatibility ? and thanks for this video, it helps me understand more about binding ;)
  • ᄃztlst주아
    ᄃztlst주아 3 года назад 😇😈😈😆😕😑😅😑😑😩😮😇😀😊😄😆😠☺
  • 박명순
    박명순 3 года назад 3ㅡㅢ ㅣㅑ😵😵😨😴😉😈😈😁😁😂😈😈😈😈😈😈😐😐😴😴😨😨😧😧😯
  • Moumene louifi
    Moumene louifi 3 года назад Thanks again Anthony. 
  • Anthony Martin
    Anthony Martin 3 года назад +Moumene louifi No Worries - The android developer docs say its still in BETA, so it may be worth avoiding for a little while. Just to be on the safe side.
  • Moumene louifi
    Moumene louifi 3 года назад awesome, can't wait to use binding :) thanks a lot.
  • Anthony Martin
    Anthony Martin 3 года назад +Moumene louifi The Data Binding Library is a support library, so you can use it with all Android platform versions back to Android 2.1 (API level 7+).To use data binding with Gradle then Android Plugin for Gradle 1.5.0-alpha1 or higher is required.
  • Денис Гладкий
    Денис Гладкий 3 года назад Allowing math and other stuff in XML is a way to bad code with buisness logic in XML. In WPF's XAML it was very right decision to allow only pure binding expressions without any calculations.
  • B Wally
    B Wally 6 дней назад Slide title resolving setter I read this slide , but i don't understand @BindingMethod(), we must write this method any where? or just explain how stuff work. I know for exemple we must write write @BindingAdapter for some attribue like <ImageView src = "@{product.image}" <TextView android : text = "@{myVariable}"/> textView.setText(myVariable); <ImageView android:src="@{user.image}"/> imageView.setImageDrawable(user.image); @BindingMethod( type = android.widget.ImageView.class, attribute = "android:src", method = "setImageDrawable")
  • Michał Krasowski
    Michał Krasowski 3 года назад Butterknife bindings seem to cover all basic cases in much easier fashion.
  • Michał Krasowski
    Michał Krasowski 3 года назад +Remmie Vail yes, of course you are right, the Butter knife functionality is limited to binding views and listeners, there is no such thing as data binding in butter knife. But still, the syntax proposed by Google's guys is ugly as hell. But this is just an opinion.
  • Remmie Vail
    Remmie Vail 3 года назад +Michał Krasowski Does butterknife allow you to bind views to actual data? I thought it just allowed you to avoid the boilerplate code of findViewById().
  • Sundara S. Yerrapragada
    Sundara S. Yerrapragada 3 года назад Really clear screen display of code ..Love it. Five stars !
  • Oussama abdallah
    Oussama abdallah Год назад Random 123 ahahaha that was hilarious xD