I am new to firebase, and I am trying to put json object data into my firebase. I know how to put data as a class object into firebase, But I want to put json object data.>
Yes, you can achieve this. Start by converting your json to a string then do the following:
String jsonString; //set to json string
Map jsonMap = new Gson().fromJson(jsonString, new TypeToken>() {}.getType());
I am using the "updateChildren" method because I want the JSON object added directly to the root of my child object
firebaseDatabaseRef.child("users").child(uid).updateChildren(jsonMap);
If you don't care or you would like to set a new node, use
firebaseDatabaseRef.child("users").child(uid).child({your new node}).setValue(jsonMap);