DictionaryForMids Forum

DictionaryForMIDs for Mobiles (Java ME; most devices from Nokia, Samsungs, RIM (Blackberry), LG, SonyEricsson, Motorola and plenty more) => General discussions => Topic started by: zz85 on 12. June 2007, 20:32:47

Title: Please Test - File Browser with Zipped Dictionary Support
Post by: zz85 on 12. June 2007, 20:32:47
Modified from 3.1.1

1. It contains a File Browser so you can select the directory you want without remembering its complete path.

2. It can load zipped dictionaries. Zip up the dictionary directory and transfer to the phone. Use the file browser to select it.

Please test to see if it works on your phone.

dfm filebrowser and zipped dicts v1.zip - 0.27MB (http://www.zshare.net/download/2245673a97baac/)

Version 2 uses a vector to reduce the number of times the zip file needs to reopens, hence reducing the security prompts. The real way to solve it would be 1) Effective method to access the File system 2) Caching 3) Certificate

dfm filebrowser and zipped dicts v2.zip - 0.27MB (http://www.zshare.net/download/2245741a37264d/)

Here's the dictionary I used for testing
dictionary_engjpn_edict.zip - 6.57MB (http://www.zshare.net/download/224581620337e2/)
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 13. June 2007, 20:58:15
Unbelievable to have those features !!!! I thought it would take much longer to get this done.

For the people who do a test: remember to restart DfM after you selected a dictionary in the settings dialogue (field "Dictionary Path"). Will be improved in the future.


I just did do a very quick test on the WTK emulator and on Nokia's S40 emulator.

1) WTK
Worked great with your "dictionary_engjpn_edict.zip" ! Did not work with the Freedict English-German jar file: after the restart 'no dictionary loaded' was displayed.

2) Nokia S40
Tested with your "dictionary_engjpn_edict.zip": the dictionary was correctly loaded after the restart. But when translating a word, the following exception was thrown:


QuoteEmulator command: C:\Nokia\Devices\S40_SDK_3rd_Edition_Feature_Pack_1\bin\S40_SD
K_3rd_Edition_Feature_Pack_1_em.exe
Creating New "Series 40 SDK 3rd Edition Feature Pack 1" Instance ...
Using Trusted simulated domain
"Series 40 SDK 3rd Edition Feature Pack 1" Instance #6136000 Ready for Future Co
nnections
        at de.kugihan.dictionaryformids.dataaccess.fileaccess.ZipInputStreamAcce
ss.openFileConnectionStream(+57)
        at de.kugihan.dictionaryformids.dataaccess.fileaccess.ZipInputStreamAcce
ss.getInputStream(+84)
        at de.kugihan.dictionaryformids.dataaccess.CsvFile.readCsvFileComplete(+
21)
        at de.kugihan.dictionaryformids.dataaccess.CsvFile.<init>(+32)
        at de.kugihan.dictionaryformids.translation.Translation.searchTranslatio
nForNormatedWord(+98)
        at de.kugihan.dictionaryformids.translation.Translation.getTranslationRe
sult(+103)
        at de.kugihan.dictionaryformids.translation.TranslationThread.doTranslat
ion(+220)
        at de.kugihan.dictionaryformids.translation.TranslationThread.run(+4)
de.kugihan.dictionaryformids.general.CouldNotOpenFileException: java.io.IOExcept
ion: failed to open file for reading
        at de.kugihan.dictionaryformids.dataaccess.fileaccess.ZipInputStreamAcce
ss.getInputStream(+182)
        at de.kugihan.dictionaryformids.dataaccess.CsvFile.readCsvFileComplete(+
21)
        at de.kugihan.dictionaryformids.dataaccess.CsvFile.<init>(+32)
        at de.kugihan.dictionaryformids.translation.Translation.searchTranslatio
nForNormatedWord(+98)
        at de.kugihan.dictionaryformids.translation.Translation.getTranslationRe
sult(+103)
        at de.kugihan.dictionaryformids.translation.TranslationThread.doTranslat
ion(+220)
        at de.kugihan.dictionaryformids.translation.TranslationThread.run(+4)
de.kugihan.dictionaryformids.general.CouldNotOpenFileException: de.kugihan.dicti
onaryformids.general.CouldNotOpenFileException: java.io.IOException: failed to o
pen file for reading

Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: zz85 on 14. June 2007, 13:29:37
Gert, thanks for your testing. Is there anyway to trace where the error is coming on the Nokia phone? What file is it trying to open?

It puzzles me too why it can load the dictionary but not let it search too.
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: zz85 on 14. June 2007, 14:19:51
Regarding the German dictionary,

1. It should be rename to a zip extension
2. If it doesn't work, the class files in the jar "zip" should be removed. Extract the dictionary folder. Zip them up again retaining the dictionary directory in it.

It should load after that. This should be done with other dictionaries.
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: jreiffers on 14. June 2007, 18:58:55
I have just tested both versions using Motorola's emulator (EmulatorA.5, v3xx). Both start up alright, but when I try to select a dictionary (i.e., when I choose "change directory"), an ArrayIndexOutOfBounds exception is thrown.

On the phone (v3xx as well) it seems to be impossible to install any of the newer versions of DfM (including these) - the installation will always quit with the error message "Anwendungsfehler" (application error). Version 2.4.2 works fine.

Cheers!
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 14. June 2007, 20:13:11
@zz85: well, in the stack trace you have the bytecode numbers that you can use to determine where the exception was raised. You need to have a class-file decompiler, such as DJ, in order to know the position of the byte code. (ok, probably you know all of this ...)
I think the easiest would be if you could install the Nokia S40 emulator yourself. Then you could for example set the logLevel higher and the log will tell you what files are opened.
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 14. June 2007, 20:20:48
@jreiffers: wow, that reads bad ! I mean the installation problems on your v3xx.

What model do you have precisely ? Maybe there is a problem with the size of the application ?

Could you do a few tests which versions do work and which don't ?

Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: jreiffers on 14. June 2007, 21:16:45
@Gert:

I just tried the English -> Turkish dictionary (http://prdownloads.sourceforge.net/dictionarymid/DictionaryForMIDs_2.3.3_EngTur_freedict.zip?download), which is 2.3.3 and 2110 kB: it works without problems, so file size doesn't seem to be an issue.

Then, I tried the 3.0.3 English-Khmer dictionary (384 kB), but the installation fails. I've already tried changing the name of the jar/jad (including updating the manifest), since the names of the newer dictionaries are quite long (32 chars - somewhere somebody said Motorola phones had issues with that), but the error message remains unchanged.

Cheers!
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: zz85 on 15. June 2007, 04:30:22
@jreiffers: Does your phone support MIDP 2.0? Or what's the jar limit of your phone? 1 of these limitations will cause the phone not to be able to load the mobile application.
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: jreiffers on 15. June 2007, 15:01:27
Quote from: zz85 on 15. June 2007, 04:30:22
@jreiffers: Does your phone support MIDP 2.0?

Yes, it does - JBenchmark 2.0 (which uses MIDP 2.0) works just fine.

Quote from: zz85 on 15. June 2007, 04:30:22Or what's the jar limit of your phone?

As I wrote yesterday, the limit is >2MB, though I don't know the exact value - so this can't be the reason why the newer versions don't work, either.

Cheers!
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 15. June 2007, 20:15:05
@jreiffers: Could you test a few different versions and tell us which do work and which not. So that for example we know that there is a problem starting with version x.y.

That would be helpful !

Thanks,
Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: jreiffers on 16. June 2007, 20:01:45
@Gert:

2.7.5@5MB(GerVN) works, 3.0.0(VieRus, MIDP 1.0) doesn't.

Cheers!
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 16. June 2007, 20:08:15
Can you install and start the current 3.1.2 version from the "Setting up a new dictionary" section (in the file DictionaryForMIDs_3.1.2_empty.zip) ?

Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: jreiffers on 16. June 2007, 20:22:13
Quote from: Gert on 16. June 2007, 20:08:15
Can you install and start the current 3.1.2 version from the "Setting up a new dictionary" section (in the file DictionaryForMIDs_3.1.2_empty.zip) ?

No, the same error message as for the other 3.x.x versions.

Cheers!
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 16. June 2007, 21:29:50
Hmmm, that's strange ... I really wonder what is going wrong there !

Do you have the time to try to track this down further ? You just could take the file DictionaryForMIDs.jar and try to modify it down to the point where it can be installed again (I suggest to leave away the JAD file for testing). For example trying to modify the file manifest.mf that is in the meta-inf directory of DictionaryForMIDs.jar. Or trying to remove some class files (and other files) from the JAR-file till finally it is possible to install DictionaryForMIDs.jar (of course the installed file will not run when class files had been removed, but this could be very useful to try to determine the cause of the installation problems).

Would you have the knowledge (and time) to do some testing like this ?

Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: jreiffers on 16. June 2007, 21:54:15
Next week I'll be quite busy, but after that I'll certainly be able to do that.

Cheers!
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 17. June 2007, 05:47:25
Phantastic !!
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Cryme on 30. December 2007, 05:26:07
Hey guys,

I just found this website.  Did you ever figure out jreiffers' problem?  I seem to have the exact same problem.  I have a Motorola K1 KRZR and I can't seem to install any DfM version above 3.x.x.  During installation of the .jar file, it says "Application Error".  Specifically I'm trying to install the Chinese-English dictionary.  I have access to the 2.7.0 version and the 3.1.2 version.  The 2.7.0 version works perfectly but the 3.1.2 version does not.  The reason I care about this is because I'm trying to create my own dictionary and your utilities use the 3.1.2 version and my new dictionary won't install, saying "Application Error" again.  What's the problem?  How can I fix it?  If it can't be fixed, can I have access to the 2.7.0 version of files to make my dictionary?

Thanks everyone,
Ryan
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 27. February 2009, 08:58:42
Joshua,

after more than one and a half year I started to integrate your improvements in the DfM baseline. Well, sometimes I may be slow, but I finally do my job ;)

One question: on the ZIP-Library from GNU Classpath that you did put in the source code tree, did you do any changes on the source files, other than adapting the package name ? I think that these are still the original files, I only wanted to ask.

By the way, I just made a quick test with a loaded JAR file (500kb in size) and it works perfectly ! But, it seems to be somewhat slow on my emulator, i.e. startup and the translation take a few seconds. Was is the same when you did your testing ?

Best regards,
Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 28. February 2009, 20:51:15
Joshua,

I made some more investigation on that topic: I believe the GNU classpath files are indeed unchanged. And it seems that the problems with the slow response time comes from using ZipInputStream. ZipFile probably would solve the performance problems cause it uses random file access, but because it requires Java SE classes for file access, you did not yet include ZipFile in the fileaccess.zip package. Is my guessing correct ?

Greetings !
Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: martinustong on 11. June 2009, 19:31:31
Hi, I am really interested in the progress of this branch, can you send me the files? the links are broken.. no one downloaded it for too long..

I am currently on blackberry 8900, I tried to load the English Chinese dictionary, my blackberry refuses every time I tried to install, Probably due to huge file size.

Thanks a lot.
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 11. June 2009, 20:30:11
Quite some progress was made in this area. Hmmm, did I build a test version with the latest status ... ? I need to check this.

I am very much interested to get your feedback how it works on your mobile !

Well, I could guess that there is a file size problem with the Jar file of the English-Chinese dictionary on your Blackberry .

Just wait till I post a test version for the latest 'loadable dictionary' support.

Best regards,
Gert
Title: Re: Please Test - File Browser with Zipped Dictionary Support
Post by: Gert on 11. June 2009, 21:03:50
Here is the latest test version for the 'loadable dictionaries':

http://www.kugihan.de/dict/download/test_versions/3.4pre-release-loadable1/DictionaryForMIDs.jad (http://www.kugihan.de/dict/download/test_versions/3.4pre-release-loadable1/DictionaryForMIDs.jad)
http://www.kugihan.de/dict/download/test_versions/3.4pre-release-loadable1/DictionaryForMIDs.jar (http://www.kugihan.de/dict/download/test_versions/3.4pre-release-loadable1/DictionaryForMIDs.jar)

Your feedback is welcome !!

Gert