Reputation: 1683
I'm testing the new Firebase library for Android, and unfortunately it's not working, here is the code that i put on the onCreate MainActivity.method :
Firebase ref = new Firebase("https://mydatabase.firebaseio.com/");
// Read data and react to changes
ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snap) {
Log.e("FIREBASE", snap.getName() + " -> " + snap.getValue());
}
@Override public void onCancelled() { }
});
Output : no message displayed and debug error :
07-15 00:01:49.020: D/ActionBarSherlock(13362): [callbackPrepareOptionsMenu] returning true
07-15 00:01:49.020: D/ActionBarSherlock(13362): [dispatchPrepareOptionsMenu] returning true
07-15 00:01:49.370: D/dalvikvm(13362): GC_CONCURRENT freed 263K, 4% free 9700K/10055K, paused 20ms+4ms
07-15 00:01:49.830: D/WebSocket(13362): ws_0 - closed with code -1 and reason:
07-15 00:01:49.830: D/WebSocket(13362): ws_0 - closing itself
07-15 00:01:49.830: D/Connection(13362): conn_0 - Realtime connection failed
07-15 00:01:49.830: D/Connection(13362): conn_0 - closing realtime connection
07-15 00:01:49.830: D/PersistentConnection(13362): pc_0 - Got on disconnect
07-15 00:01:49.830: D/PersistentConnection(13362): pc_0 - Reconnecting in 0ms
07-15 00:01:49.830: D/ViewManager(13362): Raising events for /.info/connected
07-15 00:01:49.830: D/ViewManager(13362): Marking queries complete for /.info/connected
07-15 00:01:49.830: D/ViewManager(13362): Marking queryMap complete:null
07-15 00:01:49.840: D/Connection(13362): conn_1 - Opening a connection
07-15 00:01:50.670: D/WebSocket(13362): ws_1 - closed with code -1 and reason:
07-15 00:01:50.670: D/WebSocket(13362): ws_1 - closing itself
07-15 00:01:50.670: D/Connection(13362): conn_1 - Realtime connection failed
07-15 00:01:50.670: D/Connection(13362): conn_1 - closing realtime connection
07-15 00:01:50.670: D/PersistentConnection(13362): pc_0 - Got on disconnect
07-15 00:01:50.670: D/PersistentConnection(13362): pc_0 - Reconnecting in 342ms
07-15 00:01:50.670: D/ViewManager(13362): Raising events for /.info/connected
07-15 00:01:50.670: D/ViewManager(13362): Marking queries complete for /.info/connected
07-15 00:01:50.670: D/ViewManager(13362): Marking queryMap complete:null
PS : I put the INTERNET permission on the AndroidManifest file.
PS 2 : I downloaded the chat example and it's not working too.
Upvotes: 1
Views: 1643
Reputation: 1434
This looks like an issue with Android 2.3's SSL implementation. We're working on an update to the library that works around it. Can you try running your app on an emulator with a version >= 3.0?
We just released a new version of the library (v1.0.2). Can you give it a try and see if it fixes the problem? It includes workarounds for some of the Android SSL limitations.
https://www.firebase.com/docs/downloads.html
Upvotes: 1