How do I read data from a properties
file on Android?
Here's my code for onCreate
:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
File file = new File(getPackageName()+ "/dados.properties");
Properties pp = new Properties();
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
pp.load(fis);
fis.close();
} catch (Exception e) { }
}
It always gives error in fis = new FileInputStream(file);
.