Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'd consider using <code>res/raw-&lt;qualifiers&gt;</code> as alternative to the assets. The <code>raw</code> folder can store arbitrary files in their - you guessed it - raw form. For example, a 'Hello World' article written in French and English, would be stored under:</p> <ul> <li><code>res/raw-fr</code></li> <li><code>res/raw-en</code></li> </ul> <p>The raw resource can then be opened by calling <a href="http://developer.android.com/reference/android/content/res/Resources.html#openRawResource%28int%29" rel="nofollow"><code>openRawResource(int id)</code></a> on a resources object, similar to how it works for other resources like drawables, strings etc. The id's generated by the framework will be in the familiar format of <code>R.raw.filename</code> (without file extension).</p> <p>The benefit of using this approach is that you can fully leverage Android's localization system, meaning that as a developer you basically don't have to worry about any of that at all. You can also easily add more qualifiers to further filter on device characteristics (e.g. screen size, density, platform version etc etc - <a href="http://developer.android.com/guide/topics/resources/providing-resources.html#table2" rel="nofollow">see here for a full overview</a>). The downside is that it imposes some limitations in terms of the original file name/extension and doesn't support a proper folder/file hierarchy.</p> <p>The 'better' approach (/raw vs /assets that is) will probably depend on your project's requirements.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload