android - how to create .bin file on external storage -
i used lot of examples trying understand why doesnt create file didn't , need help.
file myfile = new file(environment.getexternalstoragepublicdirectory(environment.directory_downloads), "fffffffff.bin"); try { myfile.createnewfile(); setoutputstream(new fileoutputstream(myfile)); (short = 1; <= this.array.length; i++) { this.array[i-1] = new myobject(i); } get_objoutputstream().writeobject(this.array); getoutputstream().close(); } catch (filenotfoundexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); }
the getters/setters regular, worked when wrote internal file before changed little problem not error or related array of objects
thanks help
updates:
i got no errors, run , cant find file when im looking when plug phone pc after installing , running.
and yes did wrote premition, not problem
did add permission in manifest file?
<uses-permission android:name="android.permission.write_external_storage" />
Comments
Post a Comment