Android Write file to accessible folder for windows usb file transfer -


i operating standard nexus 5 un-rooted standard vanilla android 4.4.2

i create new file accessible in windows through standard usb connector. don't want root phone.

here snippet of code:

file outputfile = new file(new file(getfilesdir().getparentfile(), "assets"), "example.xml"); 

does know of directories writable in app + readable via usb transfer ?

thank ! :)

you can create file on external storage this:

string filename = "example.xml"; string mydirectory = "mydirectory"; string externalstorage = environment.getexternalstoragedirectory().getabsolutepath();  file outputfile = new file(externalstorage + file.separator + mydirectory + file.separator + filename); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -