Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - mikezang

#16
Problems / Error " input stream already opened"
04. August 2009, 04:39:41
I modified source for my device that sopports a special JSR75, now dictionary can be loaded, but no any translation is displayed, the error message is showed if I click translate button two times.
I have closed some InputStream what I found in sources, but I am not sure how to solve this one.
Can you help me?

<code>
de.kugihan.dictionaryformids.general.CouldNotOpenFileException: java.io.IOException: input stream already opened
   at de.kugihan.dictionaryformids.dataaccess.fileaccess.JSR75InputStreamAccess.getInputStream(+93)
   at de.kugihan.dictionaryformids.dataaccess.CsvFile.readCsvFileComplete(+19)
   at de.kugihan.dictionaryformids.dataaccess.CsvFile.<init>(+32)
   at de.kugihan.dictionaryformids.translation.Translation.searchTranslationForNormatedWord(+97)
   at de.kugihan.dictionaryformids.translation.Translation.getTranslationResult(+130)
   at de.kugihan.dictionaryformids.translation.TranslationThread.doTranslation(+79)
   at de.kugihan.dictionaryformids.translation.TranslationThread.run(+4)
</code>
#17
There is no Dictionary Path item in my settings when I run it, do you know why?
#18
I also commented in file FileBrowser.java as below:
    void showCurrDir() {
//        Enumeration e;
//        FileConnection currDir = null;

//        try {
//            setTitle(currDirName);
//            deleteAll();
//            if (MEGA_ROOT.equals(currDirName)) {
//                e = FileSystemRegistry.listRoots();
//            } else {
//                currDir = (FileConnection)Connector.open("file://localhost/" + currDirName, Connector.READ);
//                e = currDir.list();
                // not root - draw UP_DIRECTORY
//                append(UP_DIRECTORY, dirIcon);
//                append(CURRENT_DIRECTORY, dirIcon);
//            }
//
//            while (e.hasMoreElements()) {
//                String fileName = (String)e.nextElement();
//
//                if (fileName.charAt(fileName.length() - 1) == SEP) {
//                    // This is directory
//                    append(fileName, dirIcon);
//                } else {
//                    // this is regular file
//                    append(fileName, fileIcon);
//                }
//            }

//            if (currDir != null) {
//                currDir.close();
//            }

//        } catch (IOException ioe) {
//            ioe.printStackTrace();
//        }
    }


now compile is ok, but even I run it, only display "No Dictionary loaded".

I am still not sure how to implement what you said in section "Implementing file access for new Java platforms"? Csn you show me more detail?

Thanks a lot.
mikezang
#19
You are right, that lib is from my device's SDK. I don't think there will have more English information about MEXA API, because such device are only for Japanese market.

Now I deleted SR75InputStreamAccess.java and ZipInputStreamAccess.java, then I commented import for FileConnection, so  void showCurrDir() can't be used as it uses FileConnection currDir = null;

What can I do?
#20
I use device's library, you can find it in attachment.
#21
I am using eclipse3.5 and netbeans6.7 with my device's emulator, can this help you?
#22
Thanks for your detail explaination.

My device supports MIDP2.0, but uses com.j_phone.io.StorageConnection for file access.

So I can delete all files that use FileConnection, then implement class to use StorageConnection, is it right?

Another idea is to make a adapter FileConeection, do you think what idea is better and simple?
#23
I am sorry that I am not sure about  DictionaryForMIDs, because it is little complex:)

I copied some sources that can't be compiled as below, even I implement DfMInputStreamAccess, it can't be compiled, so do I have to delete some source files?

in de.kugihan.dictionaryformids.dataaccess.fileaccess.JSR75InputStreamAccess.java
de.kugihan.dictionaryformids.dataaccess.fileaccess.ZipInputStreamAccess.java
import javax.microedition.io.file.FileConnection;

in de.kugihan.dictionaryformids.hmi_java_me.filebrowser.FileBrowser.java
import javax.microedition.io.file.FileConnection;
import javax.microedition.io.file.FileSystemRegistry;


in de.kugihan.dictionaryformids.hmi_java_me.DictionarySettingForm.java
import javax.microedition.io.file.FileSystemRegistry;


#24
I just downloaded source for JavaME version, the package javax.microedition.io.file.FileConnection is still needed, I thought this package is not standard in MIDP2.0, is it right?

I thought that I don't need that package when I got your reply message, it seems that I have to make a adapter class to wrap my device API to use package javax.microedition.io.file.FileConnection, may I meke sense?

Best regards
mikezang
#25
I will try to use my file system and Bitmap font for my application.

By the way, I have another question, why didn't you put links on left of menu for
http://dictionarymid.sourceforge.net/development.html
http://dictionarymid.sourceforge.net/bitmapfont.html

Thanks a lot.

mikezang
#26
Thanks for your answer.

it seems that my message is not so clearly, my phone can access file system with com.j_phone.io.StorageConnection, but it doesn't sopport javax.microedition.io.file, so I can't compile source.

I try to make a adapter class to wrap com.j_phone.io.StorageConnection, do you have any idea?

I read your source and http://dictionarymid.sourceforge.net/development.html, I want to know if there is any else information about classes for using bitmap fonts, can you help me?

Best regards

mikezang
#27
I am using a Sharp 932SH mobile phone, it doesn't support JSR75, but has another file access system, then the JSR file size has a 1M limitation, so that I have to use Loadable Dictionary.

My 1st Question is where I have to put dictionary file? and how to config it?  I try to use English - Chinese.

2nd question is where I can find more detail information about source, because I try to show Chinese text file in my Japanese mobile phone.

Thanks for your advise.

mikezang