I just can't find how to get one specified file from external storage. I know that with getExternalStoragePublicDirectory () you get the external repository directory, but I cannot get it any further. I need some method where you have to specify the file name and it returns the file. Thanx
Better than using File.separator , this is standard Java:
File.separator
final File file = new File(Environment.getExternalStorageDirectory() .getAbsolutePath(), filename);
You can simply do this:
File f = new File(Environment.getExternalStorageDirectory() .getAbsolutePath() + File.separator + fileName);
Even better:
final File file = new File(Environment.getExternalStorageDirectory(), filename);
Source: https://habr.com/ru/post/903013/More articles:Right to left layout in android - androidDetect setting "left mode" - androidAndroid: ListView is not updated on notifyDataSetChanged (); - androidLaunching an Android project using PhoneGap - androidjQuery find, each, children and access sub-children - javascriptJava method isLetterOrDigit (), isDigit (), isLetter () - javaXcode 4.2 - application loader: unable to check icon sizes, icon not found - iosDisconnecting UIActionSheet from UIBarButtonItem on iPad - iosJDBC - Statement, PreparedStatement, CallableStatement and Caching - javaCallableStatement vs Statement - javaAll Articles