Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; public class Main { static public String getString(Context context, String name) { int identifier = context.getResources().getIdentifier(name, "string", context.getPackageName()); if (identifier > 0) { return context.getResources().getString(identifier); } return ""; } static public int getIdentifier(Context context, String name) { return context.getResources().getIdentifier(name, "id", context.getPackageName()); } }