title: Generate CSV from an ArrayList Android
body: <p>I am creating an app where do some image processing on the onPreviewFrame and then generate the Y, U and V values of each frame. I then stored these values into an ArrayList.</p>
  
  <p>example from the log (Y, U , V)</p>
  
  <pre><code>10-08 05:06:10.941 20405-20405/redlight55.com.bpreader D/MyEntryData: [1590690, 2700692, 5731888]
  10-08 05:06:10.998 20405-20405/redlight55.com.bpreader D/MyEntryData: [1610252, 2699200, 5760320]
  10-08 05:06:11.014 20405-20405/redlight55.com.bpreader D/MyEntryData: [1612862, 2700420, 5763556]
  10-08 05:06:11.089 20405-20405/redlight55.com.bpreader D/MyEntryData: [1617378, 2699508, 5770000]
  </code></pre>
  
  <p>I want to store these data into a CSV file which will be saved in the internal storage of the device. 
  They should be stored as something like this</p>
  
  <p><a href="https://i.stack.imgur.com/owCqi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/owCqi.png" alt="enter image description here"></a></p>
  
  <p>this is the method where i am saving and generating the log for the ArrayList</p>
  
  <pre><code>@Override
  public void onPreviewFrame(int ySum, int uSum, int vSum) {
      img_Y_Avg = ySum;
      img_U_Avg = uSum;
      img_V_Avg = vSum;
  
      //set value of Y on the text view
      TextView valueOfY = (TextView)findViewById(R.id.valueY);
      valueY = img_Y_Avg;
      valueOfY.setText(Double.toString(img_Y_Avg));
  
      //set value of U on the text view
      TextView valueOfU = (TextView)findViewById(R.id.valueU);
      valueU = img_U_Avg;
      valueOfU.setText(Double.toString(img_U_Avg));
  
      //set value of V on the text view
      TextView valueOfV = (TextView)findViewById(R.id.valueV);
      valueV = img_V_Avg;
      valueOfV.setText(Double.toString(img_V_Avg));
  
      //store value to array list
      ArrayList&lt;Integer&gt; yAverage = new ArrayList&lt;Integer&gt;();
      yAverage.add(img_Y_Avg);
      //Log.d("MyEntryData", String.valueOf(yAverage));
  
      //store u values to array
      ArrayList&lt;Integer&gt; uAverage = new ArrayList&lt;Integer&gt;();
      uAverage.add(img_U_Avg);
      //Log.d("MyEntryData", String.valueOf(uAverage));
  
      //store u values to array
      ArrayList&lt;Integer&gt; vAverage = new ArrayList&lt;Integer&gt;();
      vAverage.add(img_V_Avg);
      //Log.d("MyEntryData", String.valueOf(vAverage));
  
  
      ArrayList&lt;Integer&gt; getValues = new ArrayList&lt;Integer&gt;();
      for(int i = 0; i &lt; uAverage.size(); i++) {
          getValues.add(yAverage.get(i));
          getValues.add(uAverage.get(i));
          getValues.add(vAverage.get(i));
      }
  
      Log.d("MyEntryData", String.valueOf(getValues));
  
  
      handler = new Handler();
      final Runnable runnable = new Runnable() {
          @Override
          public void run() {
              readingRemaining = readingRemaining -1;
  
              if (readingRemaining &gt; 0){
                  plotGraph(img_Y_Avg);
              }
          }
      };
  
      handler.postDelayed(runnable, 100);
  
      //Log.d("MyEntryData", String.valueOf(img_Y_Avg +" "+ img_U_Avg+" "+img_V_Avg));
  }
  </code></pre>
  
  <p>i have been trying to do it with opencsv but there are no files generated into the device storage. How can i do this?</p>