• Welcome to DictionaryForMids Forum.
 

how to define where to put dictionary?

Started by mikezang, 31. July 2009, 03:47:54

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gert

Where do the CLDC and MIDP Jar-files come from ? From NetBeans ?

Gert

mikezang

I use device's library, you can find it in attachment.

Gert

Hmmm, this is interesting for me. Is this library part of an SDK (Software Development Kit) or similar ? Maybe there is some non-Japanese documentation for this ? All that I could find on the internet till now is Japanese ... ok I'd like to learn some Japanese, but this would probably take me 20 years ;)

Anyway, thanks to your posting I detected that in DictionarySettingsForm the "import javax.microedition.io.file.FileSystemRegistry" is misplaced; I just removed that line and committed the updated DictionarySettingsForm to the SVN repository, see http://dictionarymid.svn.sourceforge.net/viewvc/dictionarymid/trunk/JavaME/src/de/kugihan/dictionaryformids/hmi_java_me/DictionarySettingForm.java?view=markup

The following files you can delete without problems:
in de.kugihan.dictionaryformids.dataaccess.fileaccess.JSR75InputStreamAccess.java
de.kugihan.dictionaryformids.dataaccess.fileaccess.ZipInputStreamAccess.java

Concerning: de.kugihan.dictionaryformids.hmi_java_me.filebrowser.FileBrowser.java probably the easiest is if you uncomment the calls to the JSR-75 API in this file.

Ok, I will read the forum again tomorrow.

Best regards,
Gert

mikezang

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?

Gert

Put in this file all lines in comments that use the JSR-75 API. Of course, same with all other code that causes problems with relation to this.

Gert

mikezang

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

Gert

You have to enter the "Dictionary path" in the Settings dialoge, see FAQ for more links on the loadable dictionaries.

Since you deactivated the File Browser, you will have to enter the "Dictionary path" manually.

Concerning "Implementing file access for new Java platforms"; maybe it helps if you look at the existing implementations of DfMInputStreamAccess.

Gert

mikezang

There is no Dictionary Path item in my settings when I run it, do you know why?

Gert

You are right ! In DictionarySettingsForm (http://dictionarymid.svn.sourceforge.net/viewvc/dictionarymid/trunk/JavaME/src/de/kugihan/dictionaryformids/hmi_java_me/DictionarySettingForm.java?view=markup) this field is only shown if the dictionary data files are accessed via JSR-75:

// Path to dictionary
  211 if (DictionarySettings.isUseFileAccessJSR75()) {
  212 DictionarySettings.setDictionaryPath(SettingsStore.getSettingsStore().getDictionaryPath());
  213 }


So you need to deactivate the if-statement in line 211.

In cases such as these, please 'just help yourself'  ;) Please have a look at the source when something does not work as expected, and try to correct the problem yourself. If you really get stuck, then make a posting and I can support you.

Gert

mikezang

I modified source and now I can get title screen and settings form, I also found some bugs (I think so) in source and modified them.

The problem is no any Chinese is displayed, though menu can be displayed in Chinese. check another thread what I put with some pictures.

Do you have any suggestion?