Questions about Data Binding in Android Studio -


i heard of data binding today. since wanted have try of , know it, created test project.

data binding is support repository available on api 7+. databinder, capable of saying goodbye findviewbyid (which complained lot developers) when binding application logics , layouts.

here information project: android studio:

  • current version: android studio 1.3
  • build number: ai-141.2071668
  • android sdk tools: 24.3.3
  • android platform version: mnc revision 2

project build.gradle:

buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:1.3.0-beta4'         classpath 'com.android.databinding:databinder:1.0-rc0'         // note: not place application dependencies here; belong         // in individual module build.gradle files     } }  allprojects {     repositories {         jcenter()     } } 

module build.gradle:

apply plugin: 'com.android.application' apply plugin: 'com.android.databinding'  android {     compilesdkversion 'android-mnc'     buildtoolsversion "23.0.0 rc3"     defaultconfig {         applicationid "me.danielpan.databindingsample"         minsdkversion 9         targetsdkversion 'mnc'         versioncode 1         versionname '1.0.0'     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     }     compileoptions {         sourcecompatibility javaversion.version_1_7         targetcompatibility javaversion.version_1_7     }     productflavors {     } }  dependencies {     compile filetree(include: ['*.jar'], dir: 'libs')     compile 'com.android.support:appcompat-v7:22.2.0' } 

and when run project on genymotion emulator(which nexus 5 in android 5.1.0), errors happened:

installing me.danielpan.databindingsample device shell command: pm install -r "/data/local/tmp/me.danielpan.databindingsample" pkg: /data/local/tmp/me.danielpan.databindingsample failure [install_failed_older_sdk]   device shell command: pm uninstall me.danielpan.databindingsample delete_failed_internal_error 

so, have questions:

1, delete_failed_internal_error happened many times. seems error happens when set compilesdkversion 'android-mnc' buildtoolsversion "23.0.0 rc3" so, it's problem of android build tools of version?

2, followed data binding guide, think it's old. because gradle plugin has been 1.3.0-beta4, version of databinder should have evolved since released. so, what's latest version of data binding plugin?

any tips appreciated. in advance.

p.s.:

when set version of gradle plugin 1.2.3, buildtoolsversion "22.0.1" compilesdkversion 22, , targetsdkversion 22, delete_failed_internal_error doesn't happen again, tell me why?

i can answer second question. rc1 released, though documentation has not been updated yet. read:

dependencies {    classpath "com.android.tools.build:gradle:1.3.0-beta4"    classpath "com.android.databinding:databinder:1.0-rc1" } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -