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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:01:12+00:00 2026-06-07T01:01:12+00:00

The issue I am having could be a hardware-related. In any case I’m stumped.

  • 0

The issue I am having could be a hardware-related. In any case I’m stumped.

I have written some code (that I took and modified from: Writing Text File to SD Card fails) I’ve put the code below. It works fine on my Sony Ericcson X8. However, on the Sony Ericsson Arc, I can’t find the file when I look for it on the phone! I went line by line through the code and there are no failures. It’s as if it’s on the phone and I’m just blind. I can even see in the debugger that the value of gpxfile is:

/mnt/sdcard/MyCompany/MyLog
But when I use windows explorer to look for the file, I certainly don’t see the directory MyCompany. Is there some setting on the phone that (silently) prevents writing to the SD Card?

Here is the code:

public static boolean generateNoteOnSD(String sFileName, String sBody) {
    try {
        String auxSDCardStatus = Environment.getExternalStorageState() ;
        if (!auxSDCardStatus.equals(Environment.MEDIA_MOUNTED)) {
            Log.i(TAG, "generateNoteOnSD auxSDCardSTatus: " + auxSDCardStatus);
        }

        if (auxSDCardStatus.equals(Environment.MEDIA_MOUNTED)) {
            File root = new File(Environment.getExternalStorageDirectory(), "Dexcom");
            if (!root.exists()) {
                root.mkdirs();
            }
            File gpxfile = new File(root, sFileName);
            FileWriter writer = new FileWriter(gpxfile, true);
            String currentTimeString = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date());

            writer.append(currentTimeString + ", " + sBody +System.getProperty("line.separator") );

           //writer.newLine();
            writer.flush();
            writer.close();
            Log.d(TAG,"generateNoteOnSD: Saved to file: " + sBody);
            return true;
        } else {
            return false;
        }
    } catch(IOException e) {
         e.printStackTrace();
         return false;
         //importError = e.getMessage();
         //iError();
    }

}

  • 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-07T01:01:13+00:00Added an answer on June 7, 2026 at 1:01 am

    In my case the problem was that I had the Xperia ARC attached to the laptop with a USB cable. Apparently, things don’t work quite right if you do that. No problem with the X8, so I’m guessing that it’s phone specific. Computer may be putting lock on the file thus preventing Android from updating file. Not sure why I don’t get an error though.
    Bottom line for future readers: Try disconnecting phone from computer.

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

Sidebar

Related Questions

I'm having an issue with a WCF application that I've written. When both the
I'm having an issue with a form that I have. The form allows users
I am new to SmartGWT and having this issue for long time and could
I was hoping someone could help me with a little issue I'm having trouble
I having issue that content assistant / intellisense is working in methods such as
Hi guys I am having issue I have this query: SELECT * FROM useraccount
Just started mongo and started having issue with querying already. i have a collection
I'm having some issue with var_dump.i'm using xampp 1.7.3 on windows. I think in
I am having an issue with a site in that it seems like my
I'm having issue with Action Listener of a JTable that being updated according 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.