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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:51:32+00:00 2026-06-12T06:51:32+00:00

I am working on a simple app, which should be able to access files

  • 0

I am working on a simple app, which should be able to access files from internal storage and as well as from external storage (Removable cards) like Micro SD cards (when an user inserts a SDCARD).

(Not the internal sdcard which comes with the device, I know it can be accessed using
Environment.getExternalStorageDirectory())

Is it possible to find out if an user has inserted a sdcard to the device?
If yes, Is it possible to get the path of that SD CARD?

I found that hard coding the path was not a good option, cos different devices has different paths for sdcard inserted by user.

Any help is very much appreciated.
Thank you.

  • 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-12T06:51:33+00:00Added an answer on June 12, 2026 at 6:51 am

    (Not the internal sdcard which comes with the device, I know it can be
    accessed using Environment.getExternalStorageDirectory() )

    Android consider Both removable storage media (such as an SD card) or an internal (non-removable) storage as external storage only.

    Following is form developer.android.com

    Every Android-compatible device supports a shared “external storage”
    that you can use to save files. This can be a removable storage media
    (such as an SD card) or an internal (non-removable) storage. Files
    saved to the external storage are world-readable and can be modified
    by the user when they enable USB mass storage to transfer files on a
    computer.

    To check SDCard availability you can use following code.

    private boolean isExternalStorageAvailable() {
    
            String state = Environment.getExternalStorageState();
            boolean mExternalStorageAvailable = false;
            boolean mExternalStorageWriteable = false;
    
            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;
            } 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;
            }
    
            if (mExternalStorageAvailable == true
                    && mExternalStorageWriteable == true) {
                return true;
            } else {
                return false;
            }
        }
    

    Please read http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

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

Sidebar

Related Questions

I'm currently working on a reasonably simple MVC app which allows the user to
I am working on an app which needs a very simple progress view .What
In a simple app I'm working on, I've got three related assemblies: MyCompany.Geography.Windows.Forms which
I am working on a simple Rails/jQuery HTML templater app which stores a series
I am working on a simple GPS-like app. I created a custom object which
I'm working on a program, which should list all files and it's size(for now...).
I am working on a simple app in Sinatra with DataMapper. I want to
I am working on a simple app tab-bar based application that has two views.
Working on a simple TimeTracker App. You start a timer, wait a certain time,
I am working on a simple budget app using Sinatra and DataMapper in Ruby.

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.