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?

sj

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.
Joe

        String path = "/data/data/com.company.app/files/foo.jpg";
        File f = new File (path);
        if (f.exists() && f.canRead ())
        {
            try
            {
                FileInputStream is = new FileInputStream (f);
                int size = is.available();
                contents = new byte[size];
                int got = is.read (contents);
                if (got != size)
                {
                    Log.e ("File", f.getName () + ": expected " + size + ",
got " + got + " bytes.");
                    bm = null;
                }
                else
                    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

Hi

I saw discussion where renderer allocates memory to be used by
decoder.
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.

thanks

--~--~---------~--~----~------------~-------~--~----~

2. creating custom system.img

Hi,

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

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

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