android - How to write files to a usb memory? (root) -
tablet usb plug in memory stick , access
try { runtime.getruntime().exec("su"); } catch (ioexception e) { e.printstacktrace(); } file testfile = new file("mnt/usbhost0"); boolean b1 = testfile.canread(); //b1 = true boolean b2 = testfile.canwrite(); //b2 = false
why b2 false?
my device rooted
ps. sorry english bad..
you need set app's persmissions in manifest write storage
<uses-permission android:name="android.permission.write_external_storage" />
Comments
Post a Comment