Some follow up.

I'm actually reading the bytes to put into the file off the internet
through a socket.  When I open the file for writing, I get this in the
DDMS log:

04-09 02:04:35.154: ERROR/SOCKETLOG(323): add_recv_stats recv 0
04-09 02:04:36.684: INFO/global(323): Apr 9, 2009 2:04:36 AM
java.io.BufferedWriter <init>
04-09 02:04:36.684: INFO/global(323): INFO: Default buffer size used
in BufferedWriter constructor. It would be better to be explicit if a
8k-char buffer is required.
04-09 02:04:37.013: DEBUG/dalvikvm(323): GC freed 7437 objects /
455888 bytes in 197ms

What I don't get is the fact that earlier today this was working
perfectly.  And, also the following little program works just fine:


package com.android.test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import android.app.Activity;
import android.os.Bundle;

public class FileTester extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        try{
                File outFile = new File("/sdcard/text-myfile.txt");
                if (!outFile.exists()){
                        outFile.createNewFile();
                }
                FileOutputStream out = new FileOutputStream(outFile);
                out.write("Hello World!".getBytes());
                out.close();
        }catch (IOException ex){
                ex.printStackTrace();
        }


    }
}



On Apr 8, 6:43 pm, Richard Schilling <richard.rootwirel...@gmail.com>
wrote:
> O.K., Three problems in one, perhaps all related?
>
> My application writes data to a file in the /sdcard directlry.  There
> are no errors during the write.  But, the file never shows up on the
> card, in the file browser (on the device - I use Glance).  Where did
> the file go?
>
> When trying to browse the device from my desktop, I notice the USB
> Mass Storage option is missing .. .guess that's expected since others
> in the forum explain that it was removed in this version.
>
> But, I can't get my PC to browse the memory card when it's stored in
> the phone.
>
> So, I'm stuck.
>
> Yech.
>
> Any one know what's going on?   This all just seems to add up to a
> flaky memory management problem, but I can't be sure.
>
> Cheers,
>
> Richard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to