SlideShare a Scribd company logo
1 of 17
Introduction to android studio 2.0
and Data Binding Library
Kaushal Dhruw
@drulabs
Data binding library (Beta)
• Write apps faster.
• Minimize glue code for UI.
• No more findViewById(R.id…)
• Bind data and UI with minimum lines of code.
• Move basic UI logic from java class to xml layout file.
• Bind data (custom variables) and events. Define custom attributes.
• Supported all the way back to Android 2.1
• Available on android studio 1.3+ (Gradle plugin 1.5+ required)
Setting up studio for DBL
• Prerequisites - Android studio 1.3 +, Gradle plugin 1.5.0-alpha1 +
• Project gradle file: • Module gradle file
• And done...
Writing Data Bind layouts
Change the root element of layout… To this
Old_sample_layout.xml
Dbl_layout.xml
Writing Data Bind layouts…
• What happens when an xml layout is defined with layout root tag?
• A binding file is generated. For prev example it will be DblLayoutBinding.java
• This contains references to all the child views (as public final fields).
• This binding file can now be used to populate data
• What is that <data> tag?
• In data tag we tell the layout processor that a java class will be used to populate data.
• We can import custom or android classes inside data element.
• Multiple variable declaration and imports are possible inside data tag.
• Custom attributes and more in Demo…
Without DBL… With DBL
Some Data binding expressions
android:visibility="@{vItem.even ? View.VISIBLE : View.INVISIBLE}"
android:text=@{vItem.shortName.substring(0,7)};
android:text="@{user.displayName ?? user.lastName}"
android:text="@{@string/nameFormat(firstName, lastName)}"
android:text="@{@plurals/banana(bananaCount)}“
app:ImageURL="@{vItem.imageUrl}“
app:loadingImage="@drawable/img_loading“
Binding Custom attributes
@BindingAdapter("bind:imageURL") /*can add more attributes here*/
public static void loadImage(ImageView img, String url) {
Picasso.with(img.getContext()).load(url).into(img);
}
Android studio 2.0 Preview 6
(released on Jan 20, 2016)
What is android studio???
• Google’s IDE for android development.
• Built in support for Google cloud platform.
• Flexible Gradle-based build system.
• Built on top of latest IntelliJ IDEA platform.
• Multi screen app development.
• Latest version 1.5.1.
• Available on android developer site. http://developer.android.com/sdk/index.html
Some changes since studio 1.0 (DEC 2014)
• New Memory / GPU / CPU monitor
• Vector asset studio.
• Theme editor
• Integrated SDK manager.
• Data binding support and HAXM optimizations
• Enable AdMob and Analytics from within android studio.
• Live templates for quick code insertion.
• And many more…
• Available in stable build channel.
• http://tools.android.com/download/studio/builds/2-0-preview.
• Not recommended (still in preview stage).
• Canary channel (Preview 6 available on Jan-20,2016).
• http://tools.android.com/download/studio/canary/latest
• Download a separate build.
How to get the 2.0 preview?
• IDE Enhancements
• Build System
• Android Emulators
What’s new in studio 2.0 (preview)
• IntelliJ 15 support (15.0.2).
• New GPU profiler (experimental preview).
• Google search deep linking support in built.
• Instant Run (Continued…)
• Lot of UI improvements.
IDE Enhancements
• Improved dx merger (Build tools 23.0.2+, Gradle 2.0).
• Pre-dexing dependencies. Gradle build 2-2.5 times faster.
• New experimental shrinker for debug mode.
• Shrinking only. No Obfuscation No Optimization.
• Overall build – deploy – install cycle is ~1.5 times faster.
• New protocol for ADB push / pull.
• Huge speed improvement.
• Instant Run (Gradle 2.0-alpha5+, gradlew 2.10).
• Hot swap, cold swap, freeze swap
Build System
• Completely new UI with extended controls.
• Control almost every feature of emulated device
• Drag and drop APKs and files.
• Send SMS, receive calls.
• System keyboard support & Resizing.
• Finger printing support.
• Select number of cores (experimental and based on number of cores in system)
• And more in demo.
Emulator 2.0 (requires SDK tools 25.0+)
How long would it take
to develop this?
Divide that time by 2 with
DBL
Even lesser with instant run
Introduction to Android Studio 2.0 and Data Binding Library

More Related Content

What's hot

Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentWillow Cheng
 
Latest & interesting updates #android dev
Latest & interesting updates #android devLatest & interesting updates #android dev
Latest & interesting updates #android devParesh Mayani
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studioAbdul Basit
 
How to setup unit testing in Android Studio
How to setup unit testing in Android StudioHow to setup unit testing in Android Studio
How to setup unit testing in Android Studiotobiaspreuss
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & DependeciesÉdipo Souza
 
Unit Test Android Without Going Bald
Unit Test Android Without Going BaldUnit Test Android Without Going Bald
Unit Test Android Without Going BaldDavid Carver
 
Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.UA Mobile
 
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product FlavorsAndroid Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product FlavorsStefan Martynkiw
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!Édipo Souza
 
Android studio 2.0: default project structure
Android studio 2.0: default project structureAndroid studio 2.0: default project structure
Android studio 2.0: default project structureVyara Georgieva
 
From zero to hero with React Native!
From zero to hero with React Native!From zero to hero with React Native!
From zero to hero with React Native!Commit University
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
Eclipse 2011 Hot Topics
Eclipse 2011 Hot TopicsEclipse 2011 Hot Topics
Eclipse 2011 Hot TopicsLars Vogel
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with DartGDGKuwaitGoogleDevel
 
Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]GDSCIIITBbsr
 
Generating efficient APK by Reducing Size and Improving Performance
Generating efficient APK by Reducing Size and Improving PerformanceGenerating efficient APK by Reducing Size and Improving Performance
Generating efficient APK by Reducing Size and Improving PerformanceParesh Mayani
 
Introduction to android coding
Introduction to android codingIntroduction to android coding
Introduction to android codingHari Krishna
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react nativeModusJesus
 

What's hot (20)

Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android Development
 
Latest & interesting updates #android dev
Latest & interesting updates #android devLatest & interesting updates #android dev
Latest & interesting updates #android dev
 
Introduction_to_android_and_android_studio
Introduction_to_android_and_android_studioIntroduction_to_android_and_android_studio
Introduction_to_android_and_android_studio
 
How to setup unit testing in Android Studio
How to setup unit testing in Android StudioHow to setup unit testing in Android Studio
How to setup unit testing in Android Studio
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
 
Unit Test Android Without Going Bald
Unit Test Android Without Going BaldUnit Test Android Without Going Bald
Unit Test Android Without Going Bald
 
React Native
React NativeReact Native
React Native
 
Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.
 
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product FlavorsAndroid Studio 3 - Dependency-Aware Build Variants and Product Flavors
Android Studio 3 - Dependency-Aware Build Variants and Product Flavors
 
Next Step, Android Studio!
Next Step, Android Studio!Next Step, Android Studio!
Next Step, Android Studio!
 
Android studio 2.0: default project structure
Android studio 2.0: default project structureAndroid studio 2.0: default project structure
Android studio 2.0: default project structure
 
From zero to hero with React Native!
From zero to hero with React Native!From zero to hero with React Native!
From zero to hero with React Native!
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Eclipse 2011 Hot Topics
Eclipse 2011 Hot TopicsEclipse 2011 Hot Topics
Eclipse 2011 Hot Topics
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart
 
Study Jam Session 2
Study Jam Session 2Study Jam Session 2
Study Jam Session 2
 
Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]
 
Generating efficient APK by Reducing Size and Improving Performance
Generating efficient APK by Reducing Size and Improving PerformanceGenerating efficient APK by Reducing Size and Improving Performance
Generating efficient APK by Reducing Size and Improving Performance
 
Introduction to android coding
Introduction to android codingIntroduction to android coding
Introduction to android coding
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 

Viewers also liked

But what about old browsers?
But what about old browsers?But what about old browsers?
But what about old browsers?Rachel Andrew
 
Android Fundamentals - Day 2
Android Fundamentals - Day 2Android Fundamentals - Day 2
Android Fundamentals - Day 2Mohammad Tarek
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentalsAmr Salman
 
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...Deepu S Nath
 
Gradle for Android Developers
Gradle for Android DevelopersGradle for Android Developers
Gradle for Android DevelopersJosiah Renaudin
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overviewKevin He
 
Gradle & Android Studio - Introduction
Gradle & Android Studio - IntroductionGradle & Android Studio - Introduction
Gradle & Android Studio - IntroductionKevin Pelgrims
 
Android Application Fundamentals
Android Application FundamentalsAndroid Application Fundamentals
Android Application FundamentalsVikalp Jain
 
A Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentA Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentDavid Wu
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for androidzhang ghui
 
Intents in Android
Intents in AndroidIntents in Android
Intents in Androidma-polimi
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAhsanul Karim
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI WidgetsAhsanul Karim
 
How to improve gradle build speed
How to improve gradle build speedHow to improve gradle build speed
How to improve gradle build speedFate Chang
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversCodeAndroid
 
Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesAhsanul Karim
 

Viewers also liked (20)

But what about old browsers?
But what about old browsers?But what about old browsers?
But what about old browsers?
 
Android Fundamentals - Day 2
Android Fundamentals - Day 2Android Fundamentals - Day 2
Android Fundamentals - Day 2
 
Android app fundamentals
Android app fundamentalsAndroid app fundamentals
Android app fundamentals
 
Android Fundamentals
Android FundamentalsAndroid Fundamentals
Android Fundamentals
 
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
 
Gradle for Android Developers
Gradle for Android DevelopersGradle for Android Developers
Gradle for Android Developers
 
Android gradle-build-system-overview
Android gradle-build-system-overviewAndroid gradle-build-system-overview
Android gradle-build-system-overview
 
Gradle & Android Studio - Introduction
Gradle & Android Studio - IntroductionGradle & Android Studio - Introduction
Gradle & Android Studio - Introduction
 
Android Application Fundamentals
Android Application FundamentalsAndroid Application Fundamentals
Android Application Fundamentals
 
Android Fundamentals
Android FundamentalsAndroid Fundamentals
Android Fundamentals
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
A Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentA Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android Development
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
 
Intents in Android
Intents in AndroidIntents in Android
Intents in Android
 
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & SpinnerAndroid User Interface Tutorial: DatePicker, TimePicker & Spinner
Android User Interface Tutorial: DatePicker, TimePicker & Spinner
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
How to improve gradle build speed
How to improve gradle build speedHow to improve gradle build speed
How to improve gradle build speed
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
 
Lecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & PreferencesLecture 5: Storage: Saving Data Database, Files & Preferences
Lecture 5: Storage: Saving Data Database, Files & Preferences
 

Similar to Introduction to Android Studio 2.0 and Data Binding Library

Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_authlzongren
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionDuckMa
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013DuckMa
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularityoasisfeng
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesSolstice Mobile Argentina
 
Introduction to Android- A session by Sagar Das
Introduction to Android-  A session by Sagar DasIntroduction to Android-  A session by Sagar Das
Introduction to Android- A session by Sagar Dasdscfetju
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalNAVER D2
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndy Scherzinger
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupalAndriy Yun
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to presentwesley chun
 
Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3Testbells
 
summer file - Copy
summer file - Copysummer file - Copy
summer file - CopyRakesh Kumar
 

Similar to Introduction to Android Studio 2.0 and Data Binding Library (20)

Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 
From Containerization to Modularity
From Containerization to ModularityFrom Containerization to Modularity
From Containerization to Modularity
 
Innovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best PracticesInnovation Generation - The Mobile Meetup: Android Best Practices
Innovation Generation - The Mobile Meetup: Android Best Practices
 
SSDT unleashed
SSDT unleashedSSDT unleashed
SSDT unleashed
 
Introduction to Android- A session by Sagar Das
Introduction to Android-  A session by Sagar DasIntroduction to Android-  A session by Sagar Das
Introduction to Android- A session by Sagar Das
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Android : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using AndroidAndroid : Deep dive into developing MobileApp using Android
Android : Deep dive into developing MobileApp using Android
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
Android class provider in mumbai
Android class provider in mumbaiAndroid class provider in mumbai
Android class provider in mumbai
 
Android 101 - Introduction to Android Development
Android 101 - Introduction to Android DevelopmentAndroid 101 - Introduction to Android Development
Android 101 - Introduction to Android Development
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
 
Google's serverless journey: past to present
Google's serverless journey: past to presentGoogle's serverless journey: past to present
Google's serverless journey: past to present
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3Programming in HTML5 With Java Script and CSS3
Programming in HTML5 With Java Script and CSS3
 
Android dev o_auth
Android dev o_authAndroid dev o_auth
Android dev o_auth
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
summer file - Copy
summer file - Copysummer file - Copy
summer file - Copy
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 

Recently uploaded (7)

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 

Introduction to Android Studio 2.0 and Data Binding Library

  • 1. Introduction to android studio 2.0 and Data Binding Library Kaushal Dhruw @drulabs
  • 2. Data binding library (Beta) • Write apps faster. • Minimize glue code for UI. • No more findViewById(R.id…) • Bind data and UI with minimum lines of code. • Move basic UI logic from java class to xml layout file. • Bind data (custom variables) and events. Define custom attributes. • Supported all the way back to Android 2.1 • Available on android studio 1.3+ (Gradle plugin 1.5+ required)
  • 3. Setting up studio for DBL • Prerequisites - Android studio 1.3 +, Gradle plugin 1.5.0-alpha1 + • Project gradle file: • Module gradle file • And done...
  • 4. Writing Data Bind layouts Change the root element of layout… To this Old_sample_layout.xml Dbl_layout.xml
  • 5. Writing Data Bind layouts… • What happens when an xml layout is defined with layout root tag? • A binding file is generated. For prev example it will be DblLayoutBinding.java • This contains references to all the child views (as public final fields). • This binding file can now be used to populate data • What is that <data> tag? • In data tag we tell the layout processor that a java class will be used to populate data. • We can import custom or android classes inside data element. • Multiple variable declaration and imports are possible inside data tag. • Custom attributes and more in Demo…
  • 7. Some Data binding expressions android:visibility="@{vItem.even ? View.VISIBLE : View.INVISIBLE}" android:text=@{vItem.shortName.substring(0,7)}; android:text="@{user.displayName ?? user.lastName}" android:text="@{@string/nameFormat(firstName, lastName)}" android:text="@{@plurals/banana(bananaCount)}“ app:ImageURL="@{vItem.imageUrl}“ app:loadingImage="@drawable/img_loading“ Binding Custom attributes @BindingAdapter("bind:imageURL") /*can add more attributes here*/ public static void loadImage(ImageView img, String url) { Picasso.with(img.getContext()).load(url).into(img); }
  • 8. Android studio 2.0 Preview 6 (released on Jan 20, 2016)
  • 9. What is android studio??? • Google’s IDE for android development. • Built in support for Google cloud platform. • Flexible Gradle-based build system. • Built on top of latest IntelliJ IDEA platform. • Multi screen app development. • Latest version 1.5.1. • Available on android developer site. http://developer.android.com/sdk/index.html
  • 10. Some changes since studio 1.0 (DEC 2014) • New Memory / GPU / CPU monitor • Vector asset studio. • Theme editor • Integrated SDK manager. • Data binding support and HAXM optimizations • Enable AdMob and Analytics from within android studio. • Live templates for quick code insertion. • And many more…
  • 11. • Available in stable build channel. • http://tools.android.com/download/studio/builds/2-0-preview. • Not recommended (still in preview stage). • Canary channel (Preview 6 available on Jan-20,2016). • http://tools.android.com/download/studio/canary/latest • Download a separate build. How to get the 2.0 preview?
  • 12. • IDE Enhancements • Build System • Android Emulators What’s new in studio 2.0 (preview)
  • 13. • IntelliJ 15 support (15.0.2). • New GPU profiler (experimental preview). • Google search deep linking support in built. • Instant Run (Continued…) • Lot of UI improvements. IDE Enhancements
  • 14. • Improved dx merger (Build tools 23.0.2+, Gradle 2.0). • Pre-dexing dependencies. Gradle build 2-2.5 times faster. • New experimental shrinker for debug mode. • Shrinking only. No Obfuscation No Optimization. • Overall build – deploy – install cycle is ~1.5 times faster. • New protocol for ADB push / pull. • Huge speed improvement. • Instant Run (Gradle 2.0-alpha5+, gradlew 2.10). • Hot swap, cold swap, freeze swap Build System
  • 15. • Completely new UI with extended controls. • Control almost every feature of emulated device • Drag and drop APKs and files. • Send SMS, receive calls. • System keyboard support & Resizing. • Finger printing support. • Select number of cores (experimental and based on number of cores in system) • And more in demo. Emulator 2.0 (requires SDK tools 25.0+)
  • 16. How long would it take to develop this? Divide that time by 2 with DBL Even lesser with instant run

Editor's Notes

  1. Welcome!!! Introduction
  2. The idea is to connect data model to UI elements Binds data to UI view model No Reflection. Preprocessing is done at run time It is a support library
  3. Migrating from old layouts to Data bind layouts is very easy
  4. Also explain some of the new features since earlier versions of android studio
  5. Also explain some of the new features since earlier versions of android studio
  6. Do not upgrade your current IDE, instead have a separate copy of studio 2.0 till it is in preview stage
  7. Significant huge improvements in android studio 2.0. Eclipse users please switch to android studio now. Much faster and developer friendly
  8. Other UI improvements like Project structure Welcome screen Deployment targets AVD manager Instant run is the ability to deploy code changes on the fly, more will be covered in later. Discussion topic: How does it work
  9. Hot swap – deploy code changes without app restart (App is running) Cold swap – deploy incremental changes with app restart (App is running) Freeze swap – build and deploy incrementally (app is not running) Freeze swap is out of scope DBL supported by instant run
  10. With this release emulators will be preferred over actual devices Get the latest SDK tools from tools preview channel in SDK manager Send SMS and receive calls, without having a second emulator What can be controlled: GPS location, signal strength, battery, data roaming 2G/3G/No service Power button