1

I was just thinking about what is the different between those 2 libraries

As what is the diffrenet betweent coding this:

FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("https://....firebaseio.com/");

And this:

Firebase RootRef = new Firebase("https://....firebaseio.com/");

Also I was trying to make it more simpler by using just the com.google.firebase.database library by coding:

FirebaseDatabase RootRef =
        new FirebaseDatabase("https://.....firebaseio.com/");

And it gives me error:

Error:(18, 46) error: constructor FirebaseDatabase in class FirebaseDatabase cannot be applied to given types;
required: FirebaseApp,zzbpk,zzbpb
found: String
reason: actual and formal argument lists differ in length

Aslo on pointing to FirebaseDatabase it displays:

'FirebaseDatabase(com.google.firebase.FirebaseApp, com.google.android.gms.internal.zzbpk, com.google.android.gms.internal.zzbpb)' has private access in 'com.google.firebase.database.FirebaseDatabase'

Thanks in advance wish it be simple to readers Any Ideas ?

1 Answer 1

2

They're two different major versions of the Firebase SDK:

  • com.firebase is the 1.x or 2.x SDK as it was shipped prior to I/O 2016.
  • com.google.firebase is the SDK as it's been shipped since I/O 2016. Since this version is partially bundled with Google Play Services, is matches that library's version: 10.x right now, but any 9.0 or higher includes Firebase support.

Given that we're rapidly approaching I/O 2017, you should not start any new project on the 2.x SDK anymore.

To prevent getting syntax errors:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.