title: JSON file empty when i open it with app json viewer
body: <p>With my code, when I open a <code>JSON file</code> with an app for smartphone <code>JSON VIEWER</code>, the file is empty. I do not see the content. </p>
  
  <p>Why?</p>
  
  <p>Now, I'll show you my code how I save the file in <code>json</code></p>
  
  <p>Thanks in advance everybody!</p>
  
  <pre><code>public String showResult(View v) throws IOException {
  String  result = "";
  
          JsonObject json = new JsonObject();
          for (Planet p : plAdapter.getBox()) {
              if (p.isSelected()){
                  json.put("name",p.getName());
                  json.put("distance",p.getDistance());
                  json.put("quantity",p.getQuantità());
  
              }
          }
           result=json.toString();
  
          String path = Environment.getExternalStorageDirectory()
                  .getAbsolutePath() + "/droidText/";
  
          //FileWriter file=null;
  
      /*  try {
              file = new FileWriter(path+"filename5.json");
              file.write(result);
  
  
          }catch(IOException ie){}
          finally{
  
  
              file.flush();
              file.close();
          }*/
          FileWriter file = new FileWriter(path+"filename31.json");
              file.write(result);
              file.close();
              System.out.println("Successfully wrote Json result to file.");
          /*catch(IOException r){
  
          }*/
          System.out.println(result);
          return result;
  
      } 
  </code></pre>
  
  <p>JsonObject class:</p>
  
  <pre><code>private static class JsonObject {
          public void put(String name, String name1) {
          }
      }
  </code></pre>