Created
November 24, 2013 05:34
-
-
Save avendael/7623742 to your computer and use it in GitHub Desktop.
Firebase Android client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Firebase firebase = new Firebase("https://anexample.firebaseIO.com/samplenode"); | |
firebase.addValueEventListener(new ValueEventListener() { | |
@Override | |
public void onDataChange(DataSnapshot dataSnapshot) { | |
Map data = (Map) dataSnapshot.getValue(); | |
Log.d(TAG, "::onDataChange() -- firebase data: " | |
+ dataSnapshot.getValue()); | |
Log.d(TAG, "::onDataChange() -- sample string data content: " | |
+ ((String) data.get("some_string_content"))); | |
Log.d(TAG, "::onDataChange() -- sample number data content: " | |
+ ((Long) data.get("some_number_content"))); | |
// Awesome stuff! | |
} | |
@Override | |
public void onCancelled(FirebaseError firebaseError) { | |
// Cleanup stuff | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment