My Android application attempts to read the physical sectors of the SD card by accessing the actual device (in my case, /dev/block/vold/179:1). (this is on a rooted phone, of course)
I'm able to open the device as a FileInputStream
, and read data from it. However, I can't seem to read it past the 2GB mark (my memory card is 16GB).
Is this because Android doesn't support files greater than 2GB? If that's the case, why do functions like position()
and skip()
accept long
arguments??
Does anyone have advice on how to read from the device past 2GB?
try create with a native (jni) lib and call __llseek()
int __llseek(unsigned int fd, unsigned long offset_high,
unsigned long offset_low, loff_t *result,
unsigned int whence);
I think you should add the prototype in your code because I doubt there is a direct include (sys/linux-unistd.h)
of course this approach is a bit undocumented :) but you can use java after android 3 and this trick before
man _llseek
for additional infos
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With