Android Utililty Methods Resource Get

List of utility methods to do Resource Get

Description

The list of methods to do Resource Get are organized into topic(s).

Method

PropertiesgetProperties(String name, Context context)
Read a properties file from /assets.
Resources resources = context.getResources();
AssetManager assetManager = resources.getAssets();
try {
    InputStream inputStream = assetManager.open(name);
    Properties properties = new Properties();
    properties.load(inputStream);
    return properties;
} catch (IOException e) {
...
String[]getStringArray(int arrayId)
Get a string array by its ID in the resources.
return resources.getStringArray(arrayId);
booleanappendRes(StringBuilder sb, Resources res, int resId)
append Res
Reader reader = null;
try {
    InputStream inputStream = res.openRawResource(resId);
    reader = new InputStreamReader(inputStream, "UTF-8");
    char[] buffer = new char[inputStream.available()];
    reader.read(buffer);
    sb.append(buffer);
} catch (IOException e) {
...