0

I have tried to run a command from the application to install the ffmpeg library. This is my code:

try {
    Process process =Runtime.getRuntime().exec("/system/bin/pm install ffmpeg");
    BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
} catch (IOException e) {
    e.printStackTrace();
    Toast.makeText(getApplicationContext(),"failed",Toast.LENGTH_SHORT).show();
}

Problem:

It doesn't work and prints the output "failed".

Rene Knop
  • 1,788
  • 3
  • 15
  • 27
Space
  • 133
  • 1
  • 2
  • 12

1 Answers1

0

pm is not apt, and Android does not have a standard repo from which you can install ffmpeg (alas!). It is not clear what you want to install. If your app depends on some other app being installed from PlayStore, see this method. If your app uses the ffmpeg binary (in form of executable or shared library), you must package it with your APK. Note that recently Google introduced Dynamic feature modules - a new way to package parts of your APK so that they may be downloaded on demand. One such feature for your app could contain ffmpeg.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307