Saturday, May 19, 2012

A bug in Android

There is a bug in Android version 2.3. Any device that runs this version(2.3, 2.3.1, 2.3.2 or 2.3.3) has a problem creating valid zip files. The zip files created can be opened in some decompressers, however others will complain that the format is invalid, and not unzip the file.

This is a problem for the Travel Expenses app, because it uses zip files for creating backups and restoring them. In addition, since the Open Document files are in fact zip files with another extension (the files are named .odt instead of .zip), these too are affected. When trying to open an Open Document file that's been created with the Travel Expenses app running on a Android 2.3.x device, the file may be unreadable to Open Office, Libre Office or MS Word.

I'm working on a solution to this problem.

The workaround that the user may try is the following (this is valid for both odt files and the backups of the database)
  • Create the Open Document export, or backup the database
  • Copy the file from the device to a computer
  • Rename the file with a .zip extension
  • Decompress the file with a decompressor that works (WinRar works)
  • Create a new zip file and add the files to it
  • Rename the file with the correct extension
  • Try to open the odt file in Open Office / Libre Office / MS Word
This problem has only recently come to my attention, hence no fix for this problem has been available earlier.