Is it possible to use tinify compression API in Android? I've implemented all the required stuff, but the app is crashing all the time. Here's the code:
File photo = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), imageName()+".jpg");
try {
Log.d("TINY", photo.getAbsolutePath());
Source source = Tinify.fromFile(photo.getAbsolutePath());
} catch (IOException e) {
Log.e("TINY", e.getMessage());
e.printStackTrace();
}
A am getting the following error:
FATAL EXCEPTION: main java.lang.NoClassDefFoundError: java.nio.file.Paths
If it's not possible, are there any other good APIs for image compression for Android?