how to create .json file and how to write json object into json file ...In android
<p>I am  using this code for creating the new file and write the json object in test.json file but I am unable to create file.Please find mistake and give the best result 
One things I have also write the code for  permission in manifest file..</p>

<p>Thanks,</p>

<pre><code>String fileName = "test";
        File file = new File("/data/data/packagename/test.json");
        file.createNewFile();
            DataOutputStream fos = new  DataOutputStream(openFileOutput(fileName , Context.MODE_PRIVATE));
            if(file.exists()){
                fos.write(jsString.getBytes());
                fos.close();
            }
</code></pre>
