Closed kelson42 closed 7 years ago
Can you test if you set the storage device to the SD card and then download thorough the file manager. Can you see the zim?
User has tried and it seems to work.
He has also moved the old files to the new created directory and they are now visible.
Should just be a simple fix then. The thanks for the feedback. As for the duplicate storage options is this critical for 2.0? I don't have device to test on and it would be very hard to do without device. It's a product of the same SD card being mounted in multiple places. It shouldn't be that hard to fix but I have nothing to debug it.
@mhutti1 Maybe you can fix the problem of undetected ZIM files and publish a new APK, I would then open a separate bug for the duplicates entries to be fixed later, does not sounds to critical to me.
It was a more tricky problem that I had anticipated as we have limited access to the sd card but I think I have done it.
Here is the duplicated issue: https://github.com/mhutti1/android-storage-devices/issues/1
I seems it crashes now (feedback from the user): I can open kiwix, but as soon as I go to Get Content, it searches for about half a second and then crashes. I've tried rebooting but it makes no difference.
I have also tried on my galaxy tab and everything seems to work good with build 37
Could I have a stack trace?
Never mind I think I can see it. It's weird though
So the result of this is we have learned that our download process can in certain unknown circumstances result in some 4GB chunks that cause the app to crash. Manually deleting and re-downloading appears to fix. I have given the once over of the code that @rashiq wrote but It looks sound so without reproduction steps I think this might not be fixable.
@mhutti1 @rashiq It's only an idea, but the fact that the new file seems to make pretty exactly the double of 2GB, it seems to me that for some reason, the MB counter is reseted (or maybe this is the file chunks counter)... maybe by an app restart or something like this.
The issue was that when I implemented a system to allow files to continue downloading though internet connection issues I used two variables that I thought were the start and end bytes of the chunk. They were actually the start and end bytes of the next chunk. This caused chunks to download themselves and the next chunk on internet issues. I don't think this caused a crash when opening the file and this was why it was never discovered however it does crash the app when performing certain reader methods. We only implemented these methods later and so the issue slipped through the cracks, To fix I simply made a chunks start and end bytes its actual start and end bytes.
Device is a:
Thre content on the SD card (in sub directories):
But the "Local" Tab is empty.
"Settings" > "Storage" display many entries (odd)
It looks like the SD card is detected (4) but not the content files