Sunday Jul 11, 2010

Test support for indian languages for JavaME apps

JavaME supports Unicode string objects and hence you can display text in Indian languages within your applications. Everything looks very nice when you run such application inside an emulator running on your desktop. However, things may (rather most likely) not look great when you install the application on the mobile device.

This is primarily because JavaME depends on the native support for displaying such text. This means if your device does not support Unicode font and specific encodings, you will not be able to display text in indian languages properly.

Mobile device manufacturers, in most cases, do not guarentee Unicode support. This provides a big challenge for the developer community to qualify their applications on various devices and  in the huge indian market with hundreds of low-cost/high-end devices from various manufacturers such qualification is impossible. So, that brings us to the big question of this post,
For a specific device, Is the text in Indian languages displayed correctly ??

To answer this, I thought it would be nice to have a simple application that displays text in various indian languages that can be used to confirm if their device can display the text correctly. The idea is to use this application to test the native unicode support on your mobile device.

Clearly, this app is more useful when you do not have WiFi on your device which is a big number in Indian market and really my target audience for this post. If you have WiFi on your device, you can visit this site and confirm if the device can display text properly.

This application displays the "Pledge of India" in various Indian languages. The pledge is an obvious choice for such application given the Indian context. I am sure there are some folks out there who don't quite remember the pledge now and would find this application useful in that sense as well.

This application is tested on Nokia 5800 device. I had to add the Unicode font manually to the device to get it to work and still see glyphs overlapping each other for UTF-8 encoding. I'd appreciate your test results as comments here.

Topics like installing this application or the Unicode fonts on your phone are not covered in this post as I believe there is information available on the internet and rather it is more complicated :)

Finally, Here is the unsigned jad and jar file. It supports only Hindi & Marathi as of now. feel free to post your suggestions. If you are viewing this blog from your JavaME supported phone, clicking the link of the jar file should let you install this application.

Wednesday May 23, 2007

Building JDBC for CDC/Foundation

JDBC Optional Package for CDC/Foundation Profile
was released back in 2004. This optional package is required on the CDC platform for any JDBC driver to work. As part of the Reference Implementation download, only source (and documentation) bundle was released. The intent here was that people who have ported CDC platform to their own platform of interest should be able to build JDBC Op Package from this source against the built binary.

The building instructions in the README file of the source bundle are some what vague and there was no clarity on this as CDC platform itself was not Generally Available. Recently, As part of the Open Source effort, mobile and embedded community was formed and CDC platform binaries (for Linux-x86 platform) are now easily available for download, as phoneME Advanced project. With this change, I believe it is more critical to have clarity around building this package.


The steps for Building JDBC Optional Package on phoneME Advanced platform are as below,

1. Download the JDBC Op Package source bundle from here.

2. Download the latest CDC Platform. Please note that currently, this platform is available only on Linux-x86. This means that you will need linux-x86 box to build JDBC Op package as per these instructions.

3. Prepare with JDK 1.4.2 binary. CDC Platform is compliant with JDK 1.4.x spec and so is the JDBC Op Package. You will need JDK 1.4.x 'javac' to build against the CDC.

4. Run following to build the JDBC Op Package.

4.1 cd <JDBC_Source>/cdcfoundation/src/share/jdbc/classes

4.2 <JDK1.4.x>/bin/javac -bootclasspath <CDC_HOME>/lib/<CDC_HOME>/lib/basis.jar -d <pathtoclasses> java/sql/\*.java

4.3 <JDK1.4.x>/bin/javac -bootclasspath <CDC_HOME>/lib/<CDC_HOME>/lib/basis.jar -d javax/sql/\*.java

Here note that, CDC platform contains 'basis.jar' file, as this set of binaries support Personal Basis profile. if you have built your own CDC from the source bundle with profile 'foundation' or 'Personal Profile', you should replace 'basis.jar' file as 'foundation.jar' or 'personal.jar' respectively.

4.4 cd <pathtoclasses>

4.5 <JDK1.4.x>/bin/jar cvf <JDBCOp>.jar java/sql/\*.class javax/sql/\*.class

I am planning to write a simple Makefile for linux-x86 platform which can be used with the JDBC Op package makefiles. Building the entire package will be just one 'make' command then. But, until I get there, this will be helpful, I believe.


added on May 25, 2007.

If you prefer building JDBC Op package along with CDC binary from its svn repository, then you need to add few lines to your makefiles as pointed out by Chris, here.

Monday Apr 23, 2007

JavaME session at PESIT, Bangalore

As part of the University Track and their special engagement with Bangalore's premiere college, PESIT, We were asked to do a JavaME session last saturday. The idea behind the session was to give them, basic introduction to JavaME with a presentation and followed by some hands-on with Netbeans Mobility Pack. The session also meant to provide them with the necessary information to start with JavaME projects, if they were interested. Satish Bhat and myself, we decided to share the responsibility of this session.

On Saturday, Around 55 (including 6th semester BE. and MTech.) students were present. I started with 'Introduction to CLDC' including JavaME platform overview. For CLDC, I talked about KVM, CLDC APIs, MIDP Life cycle, MIDP LCDUI and MIDlet development cycle. Other APIs such as MMAPI, Bluetooth, Location, Mobile3D, WMA were also covered to a limited extent. Satish, then continued with 'Introduction to CDC', where he covered CVM, CDC APIs, Foundation Profile, Personal Basis Profile, Personal Profile, Xlets, AGUI and he also touched upon PIM, Web Services API and other related topics for CDC platform. Both of us talked in detail about the JavaME community and presented how they can leverage this community in their project developement. The presentation was attended very well.

After the talk, We did a small Netbeans demo on how to create CLDC and CDC applications using Netbeans Mobility pack. I started with 'SMS application' development and asked them to continue that in the following hands-on session. Later, in the lab, we were kept very very busy and it was getting difficult to handle the situation with just 2 of us. Students came up with brilliant ideas for their short assignments. One group was keen on getting their password verification done and I helped them with putting the password string checks as a 'Wait Screen' task. Another group worked on adding more image resources for their version. We left some CDs in their lab that included Netbeans installers and how-to guides for CLDC and CDC.

We spent 2 hours in the lab even though we were scheduled to run only for 90 minutes. I feel, students really enjoyed their time. They were able to see their apps running on emulators and thanks to Netbeans Mobility Pack for doing excellent job by providing the simple easy-to-use tools. Feels great!




« August 2016

No bookmarks in folder