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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -