Access External Files (outside Of Avd Device) Using Android Junit
I am using Robotium to automate Android application. Created a android test project for the same. Inside project folder I want to keep some files like .properties/.xls etc. and wan
Solution 1:
You cannot access the internal structure of your java project that way. When you install your apk on the device, your java code gets converted to dex code for the Dalvik Virtual Machine, and you won't have the file structure from your project.
You can try the following:
If you only want to read the config.properties you should use the http://developer.android.com/reference/android/content/res/AssetManager.html class, and put your config.properties in /assets/ in your project.
If you also want to write your .properties file, consider creating a temporary file like this: Creating temporary files in Android.
Best Regards.
Post a Comment for "Access External Files (outside Of Avd Device) Using Android Junit"