xxxxxxxxxx
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference messagesRef = database.getReference("chats/chat_id/messages");
// Send a message
Message message = new Message(senderId, receiverId, content, timestamp);
messagesRef.push().setValue(message);