Archive for the 'Midlets' Category

DictionaryForMids needs Publicity

DFM, the short form the developers use for DictionaryForMids is need of publicity.

I did thought about it and mentioned before but it seems others on the new DFM forums feel the same.

Like what I mentioned in my first impressions in email and internal discussion, I found DictionaryForMids very good except it was a software perhaps too difficult to be found easily. Perhaps the bible and dictionary are the 2 most important java midlet I have used on a handphone, or Mobile Information Device, if that’s what MID stands for. It was perhaps also too difficult for anyone who wanted the features of DictionaryForMids as a dictionary or translator to find it on the search engine because perhaps there’s very little awareness and the link would never show up unless the term “DictionaryForMids” was search specifically.

It was interesting a friend was telling me he wanted to go into the SEO (Search Engine Optimization) field like Google Ad-sense.

Anyway back to the topic, bt-ocean was mentioning keywords like “dictionaryformid”, “dictionary”, “dict4mid”, “dictionary mobile”, “translation mobile” in the search engine will in no way point to dictionaryformids.

My suggestion was that
1. A better name for the application be used.
2. Place keywords in the meta tags of DFM’s homepage.
3. “Advertise” DFM on other webpages. This would create more awareness in the j2me community, the linking the project from other webpages esp blogs & forums, would give a higher page rank in the search engine.

Someway this post issn’t really a request for help nor complaining about DFM. Just trying how much a post on my blog would affect the search results over time. Its a little scary how searching my nick or my name actually brings this blog on the top results in couple of search engine too.

And 1 last thing if you were interested enough to read this post, I had just post a build of DFM 3.1.1. with the file browser and loadable zipped dictionary support. Would appreciate if anyone could try it and feedback if its working or not, before I commit the code to the CVS.

Additional sidetrack: (Sorry not last yet). Something which had been attracting my attention recently is a Chinese Homebrew Dictionary for NDS call NewDICTs which uses StarDict dictionaries files. I believe it got its inspiration from the commercial Korean “Touch Dictionary” and Japanese “Kanji Sonomama Rakubiki Jiten” software for the DS, perhaps one of the best and most valued stuff (imagine the cost of a electronic dictionary) for the DS.

Dictionary Browser Implemented!

I got some good news for the DictionaryForMIDs (the very cool dictionary/translator midlet for j2me compatible phones) community today. Basically its an implementation and integration of a FilePicker using codes borrowed from WTK examples and elsewhere.

Good news. I’ve got the browser implemented and working.

My next step will be the file decompression. I already have some J2SE codes to compress to an archive- we could use it to extra from old jars and place them in new files.

My current implementation I working with is tar with zlib compression. We might be able to implement zip/jar support, but I sort of given up on it at the moment. Infact, tar with zlib gives greater compression, although my guess is its slower.

File Picker

Compression in Java Implementation

Wanting to add zip/jar files on-the-fly decompression/reading implmentation for DictionaryForMids, I experimented classpath (A free/GNU replacement for Sun’s proprietary core Java class libraries)and jazzlib (A pure java implementation of the java.util.zip library) sources.

Even after I could make them compile, it seemed that some files couldn’t go through the preverifier (for unknown reasons, but i guess its some missing links or file size) so it couldn’t be packaged for mobile phones. [update] I managed to fix this problem by just looking at the errors when building the sources.

Frustrated, I look at some other alternatives.

TAR - A container file with no compression.
GZip - There are a few other implementations out there.
ZLib - I could use the files from JZLib re-implementation of zlib in pure Java..
BZip - I couldn’t find an implementation although there seemed to be from some time back.

Ideally, to get real compression, files would be tared first, then “hard” compressed at the next layer. Someone did a comparison of the different way of compression here. My tests show TAR and JZlib giving best compressions but the usual archivers (eg. Winrar, TUZip) do not open them. Tar with Gzip gives good storage for performances.

Take a look at my test codes for compressing files.

import java.io.*;
import java.util.zip.*;

public class Zip {
   static final int BUFFER = 2048;
   public static void main (String argv[]) {
      try {
         BufferedInputStream origin = null;
         FileOutputStream dest = new
           FileOutputStream("C:\\Users\\Zz85\\Desktop\\DictionaryProject\\test.zip");
         ZipOutputStream out = new ZipOutputStream(new
           BufferedOutputStream(dest));
         //out.setMethod(ZipOutputStream.DEFLATED);
         byte data[] = new byte[BUFFER];
         // get a list of files from current directory
         File f = new File("C:\\Users\\Zz85\\Desktop\\DictionaryProject\\Dictionary\\.");
         String files[] = f.list();

         for (int i=0; i < files .length; i++) {
            System.out.println("Adding: "+files[i]);
            FileInputStream fi = new
              FileInputStream(f.getParent() + "\\" + files[i]);
            origin = new
              BufferedInputStream(fi, BUFFER);
            ZipEntry entry = new ZipEntry(files[i]);
            out.putNextEntry(entry);
            int count;
            while((count = origin.read(data, 0,
              BUFFER)) != -1) {
               out.write(data, 0, count);
            }
            origin.close();
         }
         out.close();
      } catch(Exception e) {
         e.printStackTrace();
      }
   }
}

This is a classic way of compressing a folder (without its subdirectorie, but doable) to a zip file. The other methods are almost similar.


import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

import com.ice.tar.TarEntry;
import com.ice.tar.TarOutputStream;
import com.jcraft.jzlib.JZlib;
import com.jcraft.jzlib.ZOutputStream;

public class PackDictTest {
	static final int BUFFER = 2048;
	   public static void main (String argv[]) {
	      try {
	         BufferedInputStream origin = null;
	         FileOutputStream dest = new
	           FileOutputStream("C:\\Users\\Zz85\\Desktop\\DictionaryProject\\test.tar.Z");
	         TarOutputStream out = new TarOutputStream(new
	        		 BufferedOutputStream(new ZOutputStream(dest,JZlib.Z_BEST_COMPRESSION)));
	        		//BufferedOutputStream(new GZIPOutputStream(dest)));
	           		//BufferedOutputStream(dest));

	         byte data[] = new byte[BUFFER];
	         // get a list of files from current directory
	         File f = new File("C:\\Users\\Zz85\\Desktop\\DictionaryProject\\Dictionary\\.");
	         String files[] = f.list();

	         for (int i=0; i < files .length; i++) {
	            System.out.println("Adding: "+f.getParent() + File.separatorChar +files[i]);
	            FileInputStream fi = new
	              FileInputStream(f.getParent() + File.separatorChar +  files[i]);
	            origin = new
	              BufferedInputStream(fi, BUFFER);

	            File toTar = new File (f.getParent() + File.separatorChar +files[i]);
	            TarEntry entry = new TarEntry(toTar);
	            entry.setName(toTar.getName());
	            //TarEntry entry = new TarEntry(files[i]);
	            //entry.setSize( toTar.length());
	            //entry.setModTime(toTar.lastModified());

				out.putNextEntry(entry);
	            /*
	            while (true) {
	            	//System.out.println("Bad");
					int count = origin.read(data, 0, data.length);
					if (count <= 0)
						break;
					out.write(data, 0, count);
				}*/
	            /**/
	            int count;
	            while((count = origin.read(data, 0,
	              BUFFER)) != -1) {
	               out.write(data, 0, count);
	            }
	            out.closeEntry();
	            origin.close();
	         }
	         out.close();
	      } catch(Exception e) {
	         e.printStackTrace();
	      }
	   }

}

Notice the how the lines BufferedOutputStream(dest)); can be swaped with BufferedOutputStream(new GZIPOutputStream(dest))); to BufferedOutputStream(new ZOutputStream(dest,JZlib.Z_BEST_COMPRESSION))); to give an different compression easily using its wrapper classes.

Next will the issue on how to decompressing them.

What I am occupied with

Making GPS work for my hp and me
- TrekBuddy and getting offline maps.
- Wacking GPS Track & Mobile Trail Explorer sources

Testing other J2ME Software
- DictionaryForMids and its forum

NDS Homebrew
- Checking Neoflash updates
- Programming (wiki) my homebrew. See NDS Lib (guide)
- Testing other homebrews

Fixing my router problems

Bible on your Symbian Phone

Previously, I mentioned Java Bible for MIDP mobile phones (Jolon’s Go Bible), then PocketPC Bible for PDAs/*DAs (Pocket e-sword), now something not that old, but Bible for your Smartphones (Anything better than Symbian 60, which is almost any new handphone nowadays)

The software I’m using is the free, open source software named

S60Bible or Symbian Bible

Its a port/derivative from the palm bible+ which uses palm portable document.

Now, this software like other bible software, is just the engine and therefore you need to find and download the “Bible Databases” to work. (If you don’t, you will need to write or use others’ tools to create them)

Here are some links which you should be able to get more than what’s necessary.

Palm Bible Plus Premade Bibles

theChan Website of Ported Christian Bible

McLean Ministries
Other versions of symbian bible including for UIQ and more bible to downloads.

Tips
Also note, you can install commentaries too, and use the select bible function to switch between bibles/commentries. The commentaries I am using- Clark, Wesley, Matthew Henry, Geneva

Change the font to something which you can get use to

Configure the key bindings to fully control the software. I have tune my to somewhat the keys of “Go Bible”. I use left and right to scroll line-by-line, while up and down for page-by-page, 1 and 4 for next/previous verse, others for history, bookmarks, books.

I usually still using the midlet version of the bible, then switch task to s60bible to look up references.

Well, its just not good enough knowing of good software. Its time to start using and read the Bible!

Some interesting facts about the bible.

  • 66 books (39 OT, 27 NT) written over 1600 years by 36-40 different people in 3 different languages (Hebrew, Greek, Aramaic)
  • has been translated to over 1300 languages, more than 500 million copies sold in 2002 alone, and over 6.5 billion copies have been printed since 1450.
  • 7 wonders (its formation – written by different people in different places over a long period of time; its unification – one book; no contradictions; its age – most ancient of all books; its sale – best seller of all time; its interests – read by everybody, young and old, learned and unlearned; its language – a literary masterpiece despite some of its books being written by uneducated men; its preservation – most hated but preserved till today!

Other free, good software I have on my s60 phone (n-gage classic)

AutoLock - To auto-lock phone auto specified time to prevent accidental keypresses and save backlight (battery life! maybe phone bills, irritation and noise too)

OGGPlay - To play ogg files on ur phone!

DictionaryForMIDs / Oxford Dictionary Midlet - using a translation midlet engine, orginally for chinese to english i think, but it makes a powerful dictionary and tool

msvDriveE - Uses memory card to store messages. Means you free up space on ur internal memory, have much for space for storing sms, able to receive big bluetooth attachments (OBEX objects), and send files thru bluetooth bigger than ur internal memory (> 2MB)

Side track again to some interesting software I seen for pocketpc recently.

Midlet Manager - For running java/midp software on windows mobile.
Dicty - Dictionary
Shortcuts - for switching off screen, restart.. etc etc..