View Binding மற்றும் Data Binding என்பவை Android-ல் XML layouts-ல் உள்ள views-களுடன் code-ஐ இணைப்பதற்கான features-ஆகும். இவை பழைய findViewById முறையைவிட மிகவும் பாதுகாப்பாகவும் வசதியாகவும் உள்ளன. View Binding type-safe view references-ஐ வழங்குகிறது; Data Binding கூடுதலாக data-ஐ directly layouts-ல் இணைக்கிறது.
சிக்கல்: findViewById
The old way: findViewById to get view references:
val button = findViewById<Button>(R.id.myButton)
✗ verbose; NOT type-safe (cast errors); NOT null-safe (wrong id → null → crash at runtime)
→ View/Data Binding solve these.
