android - Read version.properties file laying in the root folder -


version.properties laying in root of folder. reading file gradle. want read same activity. how can read file.

i getting file no fount exception on following code:

file file = new file("/module/version.properties"); fileinputstream fis; string content = ""; try { fis = openfileinput(file); } catch (ioexception e) { e.printstacktrace();  } 

now want read same activity. how can read file.

you put file somewhere else, such assets/ or res/raw/. file not packaged in application.

or, in gradle, use properties buildconfigfield put properties in buildconfig.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -