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 6211319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:18:59+00:00 2026-05-24T06:18:59+00:00

I think I’m doing everything right to first create a folder that I can

  • 0

I think I’m doing everything right to first create a folder
that I can write to later in my app, but it doesn’t seem to be working.
Any clues as to how I’ve failed?

It correctly tries to create /mnt/sdcard/gradebook

I have uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”
in my manifest. I’m running on a real device (Samsung Galaxy S) and I’m not using the
sdcard as storage while its attached to my computer.

    boolean mExternalStorageAvailable = false;
    boolean mExternalStorageWriteable = false;
    String state = Environment.getExternalStorageState();

    if (Environment.MEDIA_MOUNTED.equals(state)) {
        // We can read and write the media
        mExternalStorageAvailable = mExternalStorageWriteable = true;
    } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
        // We can only read the media
        mExternalStorageAvailable = true;
        mExternalStorageWriteable = false;
        Toast.makeText(this,"This Application needs a writable external storage (sdcard).",Toast.LENGTH_SHORT).show();
        finish();
    } else {
        // Something else is wrong. It may be one of many other states, but all we need
        //  to know is we can neither read nor write
        mExternalStorageAvailable = mExternalStorageWriteable = false;
        Toast.makeText(this,"This Application needs a mounted external storage (sdcard).",Toast.LENGTH_SHORT).show();
        finish();

    }


    File folder = new File(Environment.getExternalStorageDirectory () + "/gradeBook");
    boolean success = false;
    if(!folder.exists()){
         success = folder.mkdir();
    }
    if (!success) {
        Log.e("FILE", "can't create " + folder);
    }
    else 
    {
        Log.i("FILE", "directory is created"); 
    }

Here is the manifest

<?xml version="1.0" encoding="utf-8"?>
  <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.ulsanonline.gradebook" 
    android:versionName="@string/version" 
    android:installLocation="auto" 
    android:versionCode="2">
    <uses-sdk android:minSdkVersion="8"></uses-sdk> 
    <application 
        android:icon="@drawable/icon" 
        android:debuggable="true" 
        android:persistent="false" 
        android:hasCode="true"
        android:minSdkVersion="8">
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.CAMERA" />
        <activity 
            android:name=".CourseWork" 
            android:label="@string/app_name" 
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
  • 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-05-24T06:19:00+00:00Added an answer on May 24, 2026 at 6:19 am

    uses-permission must be placed directly as <manifest> child, so it should be:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
        package="com.ulsanonline.gradebook" 
        android:versionName="@string/version" 
        android:installLocation="auto" 
        android:versionCode="2">
        <uses-sdk android:minSdkVersion="8"></uses-sdk> 
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.CAMERA" />
        <application 
            android:icon="@drawable/icon" 
            android:debuggable="true" 
            android:persistent="false"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think they are same thing but my boss say that is not right.
I think that asking this might be kind of silly but I'm still wondering
I think, the following can't be done in Java. But I would be happy
I think what I need is CROSS APPLY, but I can't seem to figure
I think instance variables are simple data types like int or double. Everything that
I think the file that is produced is an .asm file, any idea how
I think most people know how to do this via the GUI (right click
I think this is specific to IE 6.0 but... In JavaScript I add a
I think it can be done by applying the transformation matrix of the scenegraph
I think that java executables (jar files) are trivial to decompile and get the

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.