title: Android Firebase - Can't receive proper JSON from Firebase snapshot
body: <p>My android app connects to Firebase and pulls "Alert Objects" that are sent there by my server.</p>
  
  <p>When I export the data from Firebase, I get a beautifully formated JSON representation of the data.</p>
  
  <p>Problem:
  When I pull the data to my android device using a DataSnapshot, the data has '=' (equals signs) instead of ':' (semicolons). Also the quotations are not there.</p>
  
  <p>When I try to do something like <code>JSONObject alert = new JSONObject(data.getValue().toString());</code> I get errors for obvious reasons. I say obvious because if you look at what my code prints to the console you can see that it is no longer in valid JSON format.</p>
  
  <p>A friend mentioned that I need to do something with encoding but we didn't have time to discuss it. </p>
  
  <p>How can I iterate through these (kinda weird) Alert Objects that I have created and turn them into JSON objects within my Java so that I can access their properties like <code>alert.date</code> and <code>alert.message</code>.</p>
  
  <p>I thought screenshots would help you see what I am doing. The firebase is not secured at all so you can feel free to take a look at it. It won't really do much and when I go to production I will be moving it anyways.</p>
  
  <p><a href="https://i.stack.imgur.com/qqEw4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qqEw4.png" alt="Firebase screenshot"></a></p>
  
  <p><a href="https://i.stack.imgur.com/prmyB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/prmyB.png" alt="JSON export straight from Firebase website"></a></p>
  
  <p><a href="https://i.stack.imgur.com/LWcHi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LWcHi.png" alt="Code in Android Studio to print each object to console"></a></p>
  
  <p><a href="https://i.stack.imgur.com/g2K5A.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g2K5A.png" alt="Output to console when running app"></a></p>
  
  <p>I am sure this is a super easy question to answer, I am just not too well versed with JSON and encoding as a whole.</p>
  
  <p>Thanks!</p>