Android JUnit testing with files -


i have lot of files required junit testing don't want include in app when downloaded (a lot of them bitmaps take space). files stored in assets folder. there directory can put files in won't included when app downloaded?

we have similar situation.

create new java library , place files need in tests under src/main/resources. don't use src/test/resources or won't have visibility of files.

then import module part of test dependencies.

testcompile project(':files-module') // java modules 

or

androidtestcompile project(':files-module') // android modules 

you should able gain access files through getresourceasstream("/" + filename)

because module used dependency in tests nothing included in production code.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -