Files

Files are written and read as a stream of bytes. This means that to the Android system, a file is one thing. It does not have parts, such as different objects, within it. The advantage to this is that the system stores the data efficiently and does not have to worry about what data is stored within the stream. Thus, many kinds of data can be stored in a file. The disadvantage is that it is up to the developer to code the reading and writing of the file so that the data can be used appropriately when it is needed. For example, the developer can embed XML in the stream to identify the different types of data. Another approach is to embed commas in the file to distinguish different pieces of data. However, in either case, the user of that ...

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.