如何将Firebase数据转换为Java对象...?
2022-08-31 15:17:39
使用 Firebase 库以添加到Message(String, String)
HashMap<String, Message>
例:
Firebase fb = new Firebase(URL);
Firebase msgRef = fb.child("finished");
HashMap<String, Message> msgList = new HashMap<>();
Message msg = new Message(m, n);
msgList.put(HASHKEY, msg);
msgRef.push().setValue(msgList);
使用 Firebase 方法接收数据时,获取此表单中的字符串addValueEventListener()
{ key = finished, value = {
-Js9Rn0uttjYIGdcv8I1={Moosa={message=email, name=Kamran}},
-Js9Vsmv6BnVzOzpl2L8={Moosa={message=msgs, name=Imran}},
-Js9WtQ8yeDwVxQMFCZb={Moosa={message=samsung, name=Samad}},
-Js9RarxoJPKn4RO2HaM={Moosa={message=Message, name=Moosa}},
-Js9b6f75lwwbsqQNJz0={Moosa={message=Qmobile, name=Bilal}},
-Js9aDxt8TlgTGUccuxu={Moosa={message=last, name=Moosa}}} }
如何将其转换为消息对象.....????