java - How to listen for a single field in Firebase's Android SDK -


i trying figure out way listen single item using firebase api's. far figured out how query single item using orderbykey , equalto functions.

i tried similar listening single value, anytime change 1 value gives me whole database items when want 1 changed. i've added valueeventlistener , childeventlistener, seemed similar things.

is there way listen single item , return single item?

if understand correctly, lets assume firebase setup summary:

 yourapp:    "node": {        "subnode1": {           "value1": value,           "value2": value,           "subsubnode":{               //....values....//            },        },   "node2": { ... },   "node3": { ... }   //...and on ..// }, 

and trying listen value2? if case, is not possible. access this, need listen parent node; subnode1, , onchildevent, value.

however, if trying listen subnode1 or subsubnode, that is possible. providing path object when creating firebase object.

if post more code, modify accordingly better answer question.

edit

say wanted retrieve subsubnode. create firebase reference , add listener:

 firebase firebase = new firebase("yourfirebaseurl").child("node").child("subsubnode");  firebase.addchildeventlistener(new .....); 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -