I have several cases where my string in strings.xml is quite long and has multiple lines done with \n.
Editing however is quite annoying since it is a long line in Eclipse.
Is there a better way to edit this so it looks like it will be presented later in the textview, ie the line breaks as line breaks and the text in multiline edit mode?
Two possibilities:
1. Use the Source, Luke
XML allows literal newline characters in strings:
You just have to edit the XML code instead of using the nifty Eclipse GUI
2. Use actual text files
Everything inside the
assetsdirectory is available as a input stream from the application code.You can access those file input streams of assets with
AssetManager.open(), aAssetManagerinstance withResources.getAssets(), and… you know what, here’s the Java-typical enormously verbose code for such a simple task:the use of
Scanneris obviously a shortcut m(