GithubHelp home page GithubHelp logo

jambestwick / sdcardfile Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 2.0 49 KB

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

License: Apache License 2.0

Java 100.00%
android sdcard

sdcardfile's Introduction

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();
           }
       }

   }

sdcardfile's People

Contributors

jambestwick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sdcardfile's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.