amn31 edited a comment on issue #712:
URL: https://github.com/apache/cordova-android/issues/712#issuecomment-765892881


   The solution I found is that I got the encoded data string with:
   
   ```
   public static String getDataImageFrom(File imageFile) {
           try {
               FileInputStream fOut = new FileInputStream(imageFile);
               byte[] byteArray = new byte[(int) (imageFile.length() + 1)];
               fOut.read(byteArray);
               fOut.close();
               return "data:image/jpeg;base64, " + 
Base64.encodeToString(byteArray, Base64.DEFAULT);
           } catch(FileNotFoundException Exception) {
           } catch (IOException e) {
           }
           return null;
       }
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to