title: How to convert a file to Base64?
body: <p>Here the report contain the path(pathname in sdcard in string format)</p>
  
  <pre><code>File dir = Environment.getExternalStorageDirectory();
  File yourFile = new File(dir, report);
  String encodeFileToBase64Binary = encodeFileToBase64Binary(yourFile);
  
  private static String encodeFileToBase64Binary(File fileName) throws IOException {
      byte[] bytes = loadFile(fileName);
      byte[] encoded = Base64.encodeBase64(bytes);
  
      String encodedString = new String(encoded);
      return encodedString;
  }
  </code></pre>
  
  <p>in the byte[] encoded line getting this error.
  The method encodeBase64(byte[]) is undefined for the type Base64</p>