How to Make Directory in External Storage in Android Studio | MakeDirectory | Android Coding

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 87

  • @harshitsrivastava9903
    @harshitsrivastava9903 3 роки тому +2

    Thanks a lot ..just would like to add that for Android 10+ we cant do this directly we have to give request Legacy External Storage true in Manjfest file.Thanks✌️

  • @mdazharuddin4684
    @mdazharuddin4684 4 роки тому +16

    You uploaded this video recently, so I was expecting use of SAF. Please don't promote deprecated things. Starting from Android 11, you can't use this anymore and in Android 10, requestLegacyExternalStorage was provided so that developers can get enough time to migrate to use SAF.

    • @muhammadjawad1065
      @muhammadjawad1065 4 роки тому +2

      can you suggest to us any tutorial or website link about this topic because its not working on android 10,11

    • @mdazharuddin4684
      @mdazharuddin4684 4 роки тому

      @@muhammadjawad1065 Just go for documentation of SAF. Examples have been provided for almost every possible case.
      You should also check Android dev summit 2019 videos. They have explained everything perfectly!

    • @mdazharuddin4684
      @mdazharuddin4684 4 роки тому

      ua-cam.com/video/UnJ3amzJM94/v-deo.html

    • @mdazharuddin4684
      @mdazharuddin4684 4 роки тому

      By the way if the deadline of your app delivery is near better lower your target sdk to 28 and later after becoming familiar to saf switch it back up to 29 or 30.

    • @mdazharuddin4684
      @mdazharuddin4684 4 роки тому +1

      Bad luck. Now you have to target Android 10 or above if you want to release to play store!

  • @adityaroy1851
    @adityaroy1851 3 роки тому +2

    Bro how to add images in folder?

  • @517Amit
    @517Amit 4 роки тому +6

    This code won't work in API 29 and higher.

    • @Djsore22
      @Djsore22 3 роки тому

      Yeah bro did you find any solution?

    • @incodewetrust8862
      @incodewetrust8862 3 роки тому

      @@Djsore22 did you ?

    • @calevrodaf5546
      @calevrodaf5546 3 роки тому

      ​@@Djsore22 android:requestLegacyExternalStorage="true" in Android Manifest block "application"

    • @isuruthiwanka9448
      @isuruthiwanka9448 3 роки тому +2

      solution :
      File folder = new File(MainActivity.this.getExternalCacheDir(),"folder name");
      this worked for me...
      try this

    • @isuruthiwanka9448
      @isuruthiwanka9448 3 роки тому

      @@incodewetrust8862 try this way,
      File folder = new File(MainActivity.this.getExternalCacheDir(),"folder name");

  • @makkiansari1027
    @makkiansari1027 4 роки тому +2

    Great Work🔥 Bro.. keep it up...❤️❤️❤️❤️

  • @tpcraig1988
    @tpcraig1988 2 роки тому

    great video. Do you have a video on how to use this custom directory. For example take a photo and save in the custom directory?

  • @Djsore22
    @Djsore22 3 роки тому +1

    Android 11 not supported how can I fix that problem with that version?

  • @pratyakshsoni8567
    @pratyakshsoni8567 3 роки тому

    Please reply : getExternalStorageDirectory() is deprecated so how can i do it now ?

  • @adityaroy1851
    @adityaroy1851 3 роки тому +1

    How to delete folder?

  • @sarys73
    @sarys73 3 роки тому

    So without learning how to do this stuff I can't just record on my phone and have it save to my external SD Card?

  • @rakeshkumarsahoo234
    @rakeshkumarsahoo234 4 роки тому +2

    Plz upload a tutorial on data store in MySQL database with refresh layout

  • @CodeByAshish
    @CodeByAshish 4 роки тому +2

    Hii.. I was trying to make directory of my app in external storage from some previous days.. And here i saw your tutorial but again in confusion because my IDE shows that .getExternalStorageDirectory is deprecated now. And a cross line appears upon this tag.
    Actually I want to implement that when user install and run my app, the App Name folder must be created automatically (after permission granted by user).
    But I am unable to do this. Can you please make a tutorial on this topic? Bcz you are using a EditText and String method and its not useful for me. THANKS IN ADVANCE 😊

    • @CodeByAshish
      @CodeByAshish 4 роки тому

      @Tech Bro it is not changeable by Alt Enter because its accept this line but with Strikethrough text. And What is the code for automatically generate the folder with app name.

    • @CodeByAshish
      @CodeByAshish 4 роки тому

      @Tech Bro okay bro.. Let me implement it as it is.. I will reply if any problem accrue.

    • @CodeByAshish
      @CodeByAshish 4 роки тому +1

      @Tech Bro its works after changing to "getExternalFilesDir()" instead of "Environment.getExternalStorageDirectory" ... and make a directory in Android > data > com.PackageName > My XYZ file.
      But I want to create a directory like WhatsApp, Telegram, Android etc.
      How??

    • @CodeByAshish
      @CodeByAshish 4 роки тому

      @Tech Bro me too.. If u get any solution then plz comment or reply here 🙄

    • @CodeByAshish
      @CodeByAshish 4 роки тому +3

      @Tech Bro In this video its a very lengthy code to implement an external storage directory method.
      You can do it in just 3 easy lines as i implemented it myself.
      File file = new File (getExternalFilesDir("YourAppName") + "/subFolder" ;
      if (!=file.mkdirs()) {
      file.mkdirs();
      }
      Put this code into OnCreate method.. And Run.
      When you open your app the Package name directory will generate automatically (No need such type of EditText or Strings)

  • @astridhernandez8749
    @astridhernandez8749 3 роки тому +1

    Really useful !! I subscribe!!

  • @shahriarsharif6736
    @shahriarsharif6736 3 роки тому +1

    Thanks a lot.

  • @iamfunny2155
    @iamfunny2155 3 роки тому

    Pls how to open permission for data collector of code in user's consent on Android studio

  • @jaisuriyar5259
    @jaisuriyar5259 3 роки тому

    What to do if I want to store a pdf in that directory in Android studio??

  • @dyari009
    @dyari009 2 роки тому

    Ther is not working for android 11 , how can fixed ?

  • @ابوالحارثحمزة
    @ابوالحارثحمزة 4 роки тому

    I want create folder in SD card no phone storage

  • @DiegoLittleLion
    @DiegoLittleLion 3 роки тому +1

    That doesnt work on Android 11

  • @sonunagar6434
    @sonunagar6434 4 роки тому +1

    Bhai ek Fitness App ka tutorial bnao

    • @AndroidCoding
      @AndroidCoding  4 роки тому

      I am not providing complete app development. But you can implement all those topics which i made. I think it will help you.

  • @anasfarhad2845
    @anasfarhad2845 3 роки тому

    alertbox is showing failed to create folder mkdirs: false. I checked everything even the permission but still same alert

    • @moldainc9035
      @moldainc9035 3 роки тому +1

      Test it on the physical device not the AVD. It works on my

    • @anasfarhad2845
      @anasfarhad2845 3 роки тому

      @@moldainc9035 I have resolved this bug few months ago.Thanks for the help btw 😁

  • @shifan_sheikh4973
    @shifan_sheikh4973 3 роки тому

    plz make pdf in android

  • @fazriarrashyiputra1870
    @fazriarrashyiputra1870 4 роки тому +1

    Android Q deprecated

    • @mdazharuddin4684
      @mdazharuddin4684 4 роки тому

      Deprecated in Android 10 and removed in Android 11.

  • @ginasyakilaintania163
    @ginasyakilaintania163 3 роки тому

    deprecated