title: how to save survey results into texfile without a db?
body: <p>I tried to use this survey example <a href="https://github.com/AndreiD/surveylib" rel="nofollow">https://github.com/AndreiD/surveylib</a>, but how can I save the survey results into a texfile?</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      //Nothing fancy here. Plain old simple buttons....
  
      Button button_survey_example_1 = (Button) findViewById(R.id.button_survey_example_1);
      Button button_survey_example_2 = (Button) findViewById(R.id.button_survey_example_2);
      Button button_survey_example_3 = (Button) findViewById(R.id.button_survey_example_3);
  
      button_survey_example_1.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
              Intent i_survey = new Intent(MainActivity.this, SurveyActivity.class);
              //you have to pass as an extra the json string.
              i_survey.putExtra("json_survey", loadSurveyJson("example_survey_1.json"));
              startActivityForResult(i_survey, SURVEY_REQUEST);
          }
      });
  
      button_survey_example_2.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent i_survey = new Intent(MainActivity.this, SurveyActivity.class);
              i_survey.putExtra("json_survey", loadSurveyJson("example_survey_2.json"));
              startActivityForResult(i_survey, SURVEY_REQUEST);
          }
      });
  
      button_survey_example_3.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent i_survey = new Intent(MainActivity.this, SurveyActivity.class);
              i_survey.putExtra("json_survey", loadSurveyJson("example_survey_3.json"));
              startActivityForResult(i_survey, SURVEY_REQUEST);
          }
      });
  
  }
  
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == SURVEY_REQUEST) {
          if (resultCode == RESULT_OK) {
  
              String answers_json = data.getExtras().getString("answers");
              Log.d("****", "****************** WE HAVE ANSWERS ******************");
              Log.v("ANSWERS JSON", answers_json);
              Log.d("****", "*****************************************************");
  
              //do whatever you want with them...
          }
      }
  }
  
  
  //json stored in the assets folder. but you can get it from wherever you like.
  private String loadSurveyJson(String filename) {
      try {
          InputStream is = getAssets().open(filename);
          int size = is.available();
          byte[] buffer = new byte[size];
          is.read(buffer);
          is.close();
          return new String(buffer, "UTF-8");
      } catch (IOException ex) {
          ex.printStackTrace();
          return null;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Is it possible to add something to save a file with the survey results after the line "do whatever you want with them..." ? it looks like :) (and yes i know the getting started page from google)</p>