Wednesday, July 29, 2009

Personal 2D barcode

http://mobilecodes.nokia.com/create.jsp?terms=accepted

Tuesday, July 28, 2009

log4J internationalization & localisation

http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/
http://java.sun.com/docs/books/tutorial/i18n/index.html
http://forums.sun.com/thread.jspa?threadID=5370732&tstart=60
http://blogs.sun.com/CoreJavaTechTips/entry/logging_localized_message

Log4J internationalization
http://forums.sun.com/thread.jspa?threadID=770074



Debug java util MissingResourceException

java.util.MissingResourceException Can't find bundle for base name, locale...How did I get this exception? The crux of this problem is the requested resource, in most cases, a properties file, is not configured correctly in the classpath. For example, you have a properties file, connection.properties, in the same source directory as Java source files. Javac will compile *.java into *.class in a target directory such as build/classes, which is in your runtime classpath. But connection.properties is not copied into build/classes directory unless you either add a task after in the Ant build file, or do so manually.

How to fix it? Make sure this resource is configured correctly in the classpath through one of the following:

  • Like I said above, copy the resource from source directory to build/classes directory, which is in the classpath.
    • If your code is like ResourceBundle.getBundle("connection"), then after copying you should have build/classes/connection.properties.
    • If your code is like ResourceBundle.getBundle("com.javahowto.test.connection"), then after copying you should have build/classes/com/javahowto/test/connection.properties.
  • Or you can choose package resources into a jar file, say, connection-info.jar, which is included in runtime classpath (not needed in Javac classpath).
    • If your code is like ResourceBundle.getBundle("connection"), then connection-info.jar should contain this entry: connection.properties.
    • If your code is like ResourceBundle.getBundle("com.javahowto.test.connection"), then connection-info.jar should contain this entry: com/javahowto/test/connection.properties.
  • Or you can choose to put the resource in a separate resources directory, include resources directory in runtime classpath. This way you don't have to duplicate the resource in multiple directories/jar. The disadvantage is it's a little inconvenient at development time to have resource in a separate directory than Java code.
    • If your code is like ResourceBundle.getBundle("connection"), then you should have resources/connection.properties.
    • If your code is like ResourceBundle.getBundle("com.javahowto.test.connection"), then you should have resources/com/javahowto/test/connection.properties.

J2ME barcode libraries

available Java ME barcode libraries:
http://sourceforge.net/projects/readbarj/
http://code.google.com/p/zxing/
http://code.google.com/p/zxing/wiki/GetTheReader
http://people.inf.ethz.ch/adelmanr/batoo/index.php
http://code.google.com/p/jjil/
http://code.google.com/p/pp-barcode-reader/

http://www.jappit.com/ - mobile and web blog

articles
http://blog.erikdebruijn.nl/archives/78-Camera-phones-as-barcode-readers-increased-buying-power.html

Saturday, July 25, 2009

java localisation & Internalization

java
http://java.sun.com/docs/books/tutorial/i18n/intro/after.html
http://java.sun.com/docs/books/tutorial/i18n/resbundle/propfile.html
http://www.velocityreviews.com/forums/t153252-resourcebundle-cant-find-properties-file-unless-in-package.html
http://www.rgagnon.com/javadetails/java-0135.html

Wednesday, July 22, 2009

XML Schema

http://www.datypic.com/books/defxmlschema/chapter13.html
http://www.w3schools.com/schema/schema_simple.asp

Tuesday, July 21, 2009

Blog Recommendation

java exception handling

- http://tutorials.jenkov.com/

- http://www.javaworld.com/javaworld/jw-07-2005/jw-0711-exception.html?page=5

static Intialiser
- http://www.developer.com/java/other/article.php/2238491
- http://java.sun.com/docs/books/tutorial/java/javaOO/initial.html

Wednesday, July 15, 2009

Netbeans UTF 8 encoding

/etc folder of netbeans directory, called netbeans.conf
-J-Dfile.encoding=UTF-8