Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8667455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:58:04+00:00 2026-06-12T17:58:04+00:00

This is my directory structure on my Android sdcard sdcard/alQuranData/Reader1/Surah Here is my code

  • 0

This is my directory structure on my Android sdcard

 sdcard/alQuranData/Reader1/Surah

Here is my code to make Directories

File SDCardRoot = new File(Environment.getExternalStorageDirectory().toString() + "alQuranData/Reader1/Surah");
                Toast.makeText(getApplicationContext(), SDCardRoot.toString(), Toast.LENGTH_LONG).show();
                if (!SDCardRoot.exists()) {
                    Log.d("DIRECTORY CHECK", "Directory doesnt exist creating directory");
                    SDCardRoot.mkdir();
                }

Now alQuranData is already created in my sdcard root. If i only create Reader1 directory than it works fine, but when is add Reader1/Surah than it did not create.

I also tried mkdirs() but it doesn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:58:05+00:00Added an answer on June 12, 2026 at 5:58 pm

    Are you getting any error or exception. Please try to check the return value of mkdirs() method call. ALso try the following code:

    File SDCardRoot = new File(Environment.getExternalStorageDirectory().toString() + "/alQuranData/Reader1/Surah");
    Toast.makeText(getApplicationContext(), SDCardRoot.toString(), Toast.LENGTH_LONG).show();
    if (!SDCardRoot.exists()) {
        Log.d("DIRECTORY CHECK", "Directory doesnt exist creating directory");
        SDCardRoot.mkdirs();
    }
    

    Please also check that you have added following permission in manifest file:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    

    I just tested the following code and it is working on my end:

    File SDCardRoot = new File(Environment.getExternalStorageDirectory()
            .toString() + "/alQuranData/Reader1/Surah");
    Toast.makeText(getApplicationContext(), SDCardRoot.toString(),
            Toast.LENGTH_LONG).show();
    if (!SDCardRoot.exists()) {
        Log.d("DIRECTORY CHECK",
                "Directory doesnt exist creating directory "
                        + Environment.getExternalStorageDirectory()
                                .toString());
        boolean outcome = SDCardRoot.mkdirs();
    
        Log.d("DIRECTORY CHECK",
                "outcome for " + SDCardRoot.getAbsolutePath() + "     "
                        + outcome);
    }
    

    I have added alQaranData folder manually as mentioned in your post and added the permission and it start working at my end. Please check this code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a python project with this directory structure and these files: /home/project_root |---__init__.py
I could not understand this error, the scenario is: This is the directory structure:
My directory structure for all things programming is currently like this - The folders
I have a directory structure that looks like this: /a/f.xml /b/f.xml /c/f.xml /d/f.xml What
I have an Xcode project with a directory structure like this: MasterProjectDir/projectname.xcodeproj MasterProjectDir/ProjectSubDir/whatever.c MasterProjectDir/ProjectSubDir/etc.c
I am a beginner in SVN.I have the SVN directory structure like this: |-trunk
When creating gems, I often have a directory structure like this: |--lib |-- helpers.rb
I have this directory structure. In my project root directory I have a main
This is the directory structure of the project (maven2 is used): pom.xml /src /main
this is my directory structure /home /template /classifieds /listings I want to hide /template

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.