• Welcome to DictionaryForMids Forum.
 

Please Test - File Browser with Zipped Dictionary Support

Started by zz85, 12. June 2007, 20:32:47

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zz85

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

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

Here's the dictionary I used for testing
dictionary_engjpn_edict.zip - 6.57MB

Gert

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

zz85

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.

zz85

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.

jreiffers

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!

Gert

@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.

Gert

@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

jreiffers

@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!

zz85

@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.

jreiffers

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!

Gert

@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

jreiffers

@Gert:

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

Cheers!

Gert

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

jreiffers

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!

Gert

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