This is for a main code for all firebase setup need to be add in code private FirebaseDatabase database = FirebaseDatabase. getInstance (); private DatabaseReference mDatabase = database . getInstance ().getReference( "food_level" ); private DatabaseReference mDatabase1 = database . getInstance ().getReference( "bubbler" ); //decalre the progressBar pb = (ProgressBar) findViewById (R.id. progressBar3 ); // Read from the database in rea time mDatabase .addValueEventListener( new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { // This method is called once with the initial value and again // whenever data at this location is updated. value = dataSnapshot.child( "current_level" ).getValue( long . class ); Log. d ( TAG , "Value is: " + value ); ...
Auto Food Feeding System For Fisher tank in Zoology Department (IOT)