• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Downloading to & accessing /files directory

kadmos

Newbie
my apologies if this is explained elsewhere and i have not found the correct way to phrase the query...

i am updating an app i developed so that it downloads xml files it needs for content management. the files download successfully to the emulator but are not placed in the /files directory that openFileInput() is attempting to read from. i am admittedly unsure as to the proper overall solution here - app originally used packaged XML and was fed to an XMLPullParser - but i cant even get as far as attempting to parse new XML at present because my app cant find the new file sitting in /data/data/[myApp]/ and not /data/data/[myApp]/files and i cant figure out how to get it in there. the download doesnt work at all if i add that folder to path.

thank you anyone.
 
If they're being downloaded they must be going somewhere, right?

You can debug it by using File.getAbsolutePath() to find out where they're going :-)
 
i knew where the files were going, they just just wernt going where i needed them to go:

they were landing here: /data/data/com.my.app/ where openfileinput() cant see them

instead of here: /data/data/com.my.app/files/

worked once i specified the output path like this
OutputStream output = new FileOutputStream(fileDir + "/" + fileName);
 
Back
Top Bottom