File Size Limitation for XML Parsing?

yonson

Active Member
Licensed User
Longtime User
Hi

I'm using the sax parser to read in an xml file and write it to the database. It works just fine until the xml file size approaches 1MB, then I get the error:-

Dim in As InputStream
If (File.Exists(File.DirAssets, "db.xml")) Then
in = File.OpenInput(File.DirAssets, "db.xml")
Dim reader As TextReader
reader.Initialize(in)

parser.Parse2(reader,"Parser")
'parser.Parse(in, "Parser")
in.Close
End If

for the line :-

parser.Parse2(reader,"Parser")

I receive a 'LastException - java.io.IOException'

I've been testing this for a while now as I assumed it must be something with either my code or some invalid xml text, but both are fine, and I've noticed it falls over around 1MB. Can anyone help with a workaround?

Thanks!


(N.B. I've also posted this is the xml Sax parsing section but thought this could be a good place to add it so others can find it.
 

yonson

Active Member
Licensed User
Longtime User
this is something which belongs in the bugs list - I searched for this and couldn't find a definitive answer. I'm sure others have found this problem too and it is more widespread than just the SAX parsing issue where I also posted, but an issue with file size for anything supplied with the app.

The only solution seems to be :

"The issue is that Android is unable to unpack compressed files larger than 1mb (stored inside the APK file). The workaround for this issue is to change the database extension to jpg. Then the Android packager doesn't compress the file and it can be larger than 1mb."

this belongs in the main documentation as it is a major design consideration as the solution is so unelegant.
 
Top