i want to save the user's data in json file in a internel memory but it doesn't work what's the problem ???? this is the code ...................................................................................................................
public JSONObject addToJson(Context context, String email,String password)throws Exception{
    String id_P = UUID.randomUUID().toString();
    JSONObject jsonObject = new JSONObject();
    jsonObject.put("id_P",id_P);
    jsonObject.put("Email",email);
    jsonObject.put("password",password);
    
    String j = jsonObject.toString();
    System.out.println(j);
    File file = new File(context.getFilesDir(),"dbApp.json");
    FileWriter fileWriter = new FileWriter(file);
    BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
    bufferedWriter.write(j);
    bufferedWriter.close();
    return jsonObject;
}
 
     
    