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. Passing pmem FDs from OMX to MIO


I saw discussion where renderer allocates memory to be used by
I would like to pass pmem fds from omx component to MIO. [ a specific
custom audio MIO] . Can some one elaborate on the omx->pv and pv->Mio
interface changes to achieve something like this ? ideal thing would
be to get fd as a parameter along with data pointer , data length ,
cmdid, timestamp etc in MIO through the writeasync call. and then
again , it is needed only for a specific MIO implementation, without
having to change writeasync api for others.



2. creating custom system.img


How do I break an created system.img to /system directory, put in files
which I want to, and re-create system.img ?

--Pavan Savoy


3. Android/iPhone costs in the UK

4. how to read radio stream for web

5. unable to launch Emulator.

6. GLSurfaceView remove problem

7. Camera Preview 90 degree rotated