Two possibilities:
1. Use the Source, Luke
XML allows literal newline characters in strings:
<string name="breakfast">eggs
and
spam</string>
You just have to edit the XML code instead of using the nifty Eclipse GUI

2. Use actual text files
Everything inside the assets
directory is available as a input stream from the application code.
You can access those file input streams of assets with AssetManager.open()
, a AssetManager
instance with Resources.getAssets()
, and… you know what, here’s the Java-typical enormously verbose code for such a simple task:
View view;
//before calling the following, get your main
//View from somewhere and assign it to "view"
String getAsset(String fileName) throws IOException {
AssetManager am = view.getContext().getResources().getAssets();
InputStream is = am.open(fileName, AssetManager.ACCESS_BUFFER);
return new Scanner(is).useDelimiter("\\Z").next();
}
the use of Scanner
is obviously a shortcut m(