dumbledore / AlbiteREADER

A feature-rich e-book reader for the Java Mobile platform. Currently works with txt, xhtml and epub files. Supported features include touch scrolling, images, styling and multilingual hyphenation, on-touch dictionaries, units converter, table of contents. Uses the Droid Serif font through it's own font implementation scheme.
http://albite.org/reader_j2me
72 stars 21 forks source link

Last book didn't get saved. #165

Closed dumbledore closed 14 years ago

dumbledore commented 14 years ago

war and peace didn't get saved:

  1. on opening the app, it loaded the previously used book, not war and peace
  2. on opening the book, it loaded it from the start, not from the point I closed it.
dumbledore commented 14 years ago

No. 2: The reader didn't completely save the whole .alx file. It saved 186 out of 380 chapters.

dumbledore commented 14 years ago

No. 1: Because it couldn't finish with No. 2, it didn't even get to writing to the RMS.

dumbledore commented 14 years ago

It worked when opening another book. It saved everything ok. So, it seems that the exit procedure actually killed the saving process because it was taking too long. Must think of something else.

dumbledore commented 14 years ago

Well, it can't be totally avoided, but I've done a few things that make some good:

  1. When saving the alx, the data is first stored into a ByteArrayOutputStream, so that file corruption might be prevented
  2. Saving the alx is left for the last step so that all other operations would be completed first
  3. the alx file is much smaller now, due to extreme shortening of tags, i.e. tags and attributes in the alx file are shortened to 1 letter. It does make some good: ALX files are smaller and they load/save faster.