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

  • Home
  • SEARCH
  • 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 7997909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:05:01+00:00 2026-06-04T15:05:01+00:00

I am developing a program that need read/write some files from sdcard or internal

  • 0

I am developing a program that need read/write some files from sdcard or internal storage at runtime. When I mount the sdcard in my phone it run correctly but if i unmount sdcard my application raises some error.
What I have to do for phones that have not card slot like Htc one x or phones that have not any sdcard inserted? how i can write on those phones storage? I don’t want write this file into /data/data/my.app.package folder. I want write somewhere that files can be read from another apps.
first I check storage status with this code and if sdcard be inserted and writable i have not any problem. but if sdcard does not exists i realy don’t know what i have to do.

string _location;  
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
          _location=Environment.getExternalStorageDirectory()+"/myfolder/";
          Toast.makeText(context, _location, 1000).show();
      }
      else
      {
          _location="/myfolder/"
          Toast.makeText(context, Environment.getExternalStorageDirectory().toString(), 1000).show();

      }

      mysync mys=new mysync(); // Asynctasc that writes some file on _location path
      mys.execute(_location);

i am so confused and undortunately i haven’t any phone with big internal storage. please help me.

  • 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-04T15:05:04+00:00Added an answer on June 4, 2026 at 3:05 pm

    I am developing a program that need read/write some files from sdcard or internal storage at runtime.

    Here, and in your question title, you say you want to write to internal storage. Later, you say that you do not want to write to internal storage.

    Which is it?

    What I have to do for phones that have not card slot like Htc one x or phones that have not any sdcard inserted?

    External storage != “sdcard”. External storage can be whatever the device manufacturer wants, so long as it meets the terms of the Compatibility Definition Document. Hence, external storage can be removable (e.g., SD card) or not (e.g.,. dedicated portion of on-board flash). And, on Android 3.0+, external storage is merely a special subdirectory on the same partition that contains internal storage.

    You only care about whether external storage is presently available or not. It should be available pretty much all of the time on Android 3.0+ devices. It will be unavailable on Android 1.x and 2.x devices if the device is plugged into a host computer and the host computer has mounted the device’s external storage (e.g., as a drive letter on Windows).

    if sdcard does not exists i realy don’t know what i have to do.

    You ask the user to please unmount their device from their host computer. Or, you decide to write to internal storage in those cases.

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

Sidebar

Related Questions

I'm developing a program that makes some floating points calculations. Is there any way
I'm developing a PyQt program that will soon switch from an xml type backend
I am developing a C# program that will load files and get information such
I am developing program which need to interact with COM ports. By learning from
I am developing in python a file class that can read and write a
I'm developing some code that is simulating network equipment. I need to run several
first question here. I'm developing a program in C# (.NET 3.5) that displays files
I'm developing a program in C# and need a mutable variable that is available
I am currently developing a program that uses C#'s Dictionary container (specifically, SortedDictionary). This
I'm developing a program that would require huge amount of memory, and I want

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.