If this is what you got so far:
InputStream letturaEasy = getResources().openRawResource(R.raw.max_easy);
Then all that needs to be done is to convert that to a String:
String result = getStringFromInputStream(letturaEasy);
And finally, to int:
int num = Integer.parseInt(result);
By the way, getStringFromInputStream()
was implemented here:
private static String getStringFromInputStream(InputStream is) {
BufferedReader br = null;
StringBuilder sb = new StringBuilder();
String line;
try {
br = new BufferedReader(new InputStreamReader(is));
while ((line = br.readLine()) != null) {
sb.append(line);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return sb.toString();
}