Should FirebaseDatabase.getInstance() be used sparingly?

后端 未结 1 1371
无人共我
无人共我 2021-01-25 03:41

For example when I use a SQLiteDatabase in android, it is generally not a good idea to open/close lots of SQLiteDatabase helpers. Instead it is better to create a sort of single

相关标签:
1条回答
  • 2021-01-25 04:41

    FirebaseDatabase and DatabaseReference objects can be considered relatively cheap references to the underlying resources.

    The Firebase SDK manages such things behind the scenes. Only the first call to FirebaseData.getInstance() will do the set up work, subsequent calls (within the same process) will simply re-use what was done already.

    0 讨论(0)
提交回复
热议问题