Basic file input / output tutorial

by superjet » Thu, 12 Mar 2009 10:22:23 GMT

Sponsored Links
 I'm new to Java/Android, can anyone recommend a tutorial on android
that introduces reading and writing flat files?


ps, if this is a double post, sorry, but I posted several hours ago
and it seems it never went through.


Basic file input / output tutorial

by superjet » Thu, 12 Mar 2009 22:16:11 GMT

 Sorry, this is a duplicate:

Sponsored Links

Basic file input / output tutorial

by Joseph Arceneaux » Fri, 13 Mar 2009 01:57:57 GMT

 I'm not aware of a tutorial, but it's pretty easy - here's some code that
reads in a file.  Check out the File and File*Stream classes.

        String path = "/data/data/";
        File f = new File (path);
        if (f.exists() && f.canRead ())
                FileInputStream is = new FileInputStream (f);
                int size = is.available();
                contents = new byte[size];
                int got = (contents);
                if (got != size)
                    Log.e ("File", f.getName () + ": expected " + size + ",
got " + got + " bytes.");
                    bm = null;
                    bm = BitmapFactory.decodeByteArray (contents, 0, size);
            catch (Exception e)
                Log.e ("FileSave", e.toString());


Basic file input / output tutorial

by superjet » Sun, 15 Mar 2009 13:13:21 GMT

 Thanks man! I'll give this a shot tomorrow night.


Other Threads

1. ListView: Disable Focus Highlight


I've set the row (view) being used in a ListView as non-focusable
along with non-clickable and have set the listview's focusable flag to
false as well. However, I still get the yellow highlight when I use
the scroll-ball on my device. How can I disable the yellow highlight
and use my own special view/color instead upon focus?

Any help would be much appreciated.



2. question about sysfs interface for backlight adjustment

We'd welcome patches to remove this kind of hard-coding.  The that is there
now is just what is needed to support the current shipping devices.


3. File Reading & Writing Problem

4. Question on Multicomplete Text View

5. Making a button disappear and appear based on focus

6. Touch screen Issue with Android { Jun'ichi}

7. How to align a widget to the bottom of the screen in a FrameLayout?