when I run this program(I'm use the mp4prasser Library) I receive an exception:
java.io.IOException: open failed:EACCES (Permission denied)
but in the Manifest I set the permission:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
this is the code(API 17):
public class MainActivity extends AppCompatActivity {
Button mButton;
String Path;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mButton=(Button)findViewById(R.id.button);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Path= Environment.getExternalStorageDirectory().toString()
+File.separator+"AAAATAG"+File.separator+"abcde.mp4";
startTrim(Path,Environment.getExternalStorageDirectory().toString(),50000,100000);
} catch (IOException e) {
Toast.makeText(MainActivity.this, e.toString(), Toast.LENGTH_SHORT).show();
}
}
});
}
to see the code of the func startTrim()
:
http://pastebin.com/LDjn3Y7f