Skip to content

android all sdk versions sdcard TF inner or removeable card read write.

License

Notifications You must be signed in to change notification settings

jambestwick/SdCardFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SdCardFile

android all sdk versions sdcard TF inner or removeable card read write.

image The above picture shows the built-in card, 432D-1120 is an external TF card, and the simulation is the built-in sdcard file

After Android 9.0, it was found that the file manager failed to write when writing to the external SD card. The File.canWrite() method found that it returned false. After discussing the tracking and positioning, it was found that Google caused The result of a change: Google APP is no longer free to operate, but also a protection for the system. But he created it externally by default Cache and files under Android/data/com.xxx.xxx (xxx is the package name of your application) can be read and written. image_tf

Of course, the necessary permissions in AndroidManifest.xml are still required. Of course, the necessary permissions in AndroidManifest.xml are still required.

There are also dynamic permissions after 6.0 to apply for by yourself

   private void checkPermission() {
       if (Build.VERSION.SDK_INT >= 23) {
           if (ContextCompat.checkSelfPermission(this.mActivity, "android.permission.WRITE_EXTERNAL_STORAGE") != 0) {
               if (ActivityCompat.shouldShowRequestPermissionRationale(this.mActivity, "android.permission.WRITE_EXTERNAL_STORAGE")) {
                   this.mActivity.requestPermissions(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 110);
               } else {
                   this.mActivity.requestPermissions(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 110);
               }
               return;
           }
           if (this.isScreenshot) {
               this.saveToFile();
           } else {
               this.recordClick();
           }
       }

   }

About

android all sdk versions sdcard TF inner or removeable card read write.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages