JSON FORMA
Hi thank you for this guide i want to change the JSON FORMA for location message how can i do it ? i try to add attribute to LocationModel (String type ) to get this forma { "chatmodel":{ "-KLId9H8NBsmrwO6SKEo" : { "mapModel" : { "latitude" : "-3.084669", "longitude" : "-60.010532" ======> "Type": "location" }, "timeStamp" : "1467060908238", "userModel" : { "name" : "Alessandro Barreto", "photo_profile" : "xxxxxxxxxxxxxxxxxxx" } }, ... }
The JSON forma is created in response to the object or items that is passed to it. So I think all you would need to do to get this extra field is to add "type" as a variable in the mapModel class, and then make sure the type is defined when first passing it to the database.
Change it in the MapModel.java file, alter in ChatFirebaseAdapter and MainActivity if needed.