Android Tutorial

(avery) #1

By : Ketan Bhimani


298 

Reading XML Files

The Android SDK includes several utilities for working with XML
files, including SAX, an XML Pull Parser, and limited DOM, Level 2
Core support. Table lists the packages helpful for XML parsing on
the Android platform.

Important XML Utility Packages

Working with Other Directories and Files on the Android File
System

Using Context.openFileOutput() and Context.openFileInput() are
great if you have a few files and you want them stored in the /files
subdirectory, but if you have more sophisticated file-management
needs, you need to set up your own directory structure. To do this,
you must interact with the Android file system using the standard
java.io.File class methods.

The following code gets a File object for the /files application
subdirectory and retrieves a list of all filenames in that directory:
Free download pdf