Simple file reading/writing

One of the oldest and simplest ways to persist data in every system and on every language is to create a file, write our data into it, and eventually read that data at a determined time. Despite the perceived simplicity of reading and writing files, there are some obstacles to overcome in Android for security reasons. Indeed, applications are not allowed to write to/read from every part of the phone. Moreover, the file could be formatted in different ways. In this recipe, we will focus on how to read and write simple files.

Getting ready

For this recipe we will continue to use the project created in the previous recipe.

How to do it...

In the introduction of this recipe we state that, for security reasons, applications ...

Get Xamarin Studio for Android Programming: A C# Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.