MediaPlayer.setDataSource(String) not working with local files
Alternative Solution #1: Using Resources.getIdentifier() Why not use getResources().getIdentifier() to get id of the resource and use the static MediaPlayer.create() as usual? public int getIdentifier (String name, String defType, String defPackage) getIdentifier() takes your resource name (test0), resource type(raw), your package name and returns the actual resource id. MediaPlayer mp; //String filename = “android.resource://” + … Read more