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.


Thursday Nov 29, 2007

Apache Derby now tested with phoneME advanced

Apache Derby is now tested with the open source JavaME CDC stack, popularly known as phoneME advanced platform. The Apache derby community recently carried out this exercise and it did not take them long to flag GREEN.

So, Try Apache derby on phoneME advanced !

For more information on the Java ME support, please follow the Apache Derby Wiki page.
 

Friday May 25, 2007

JavaDB on JavaME platform

As the consumer devices get more sophisticated, more complicated applications will run on devices and there will be greater need to manage the application data. The need for running database engine on small devices will thus be very critical.

JavaDB, a cost effective, easy to use, fully featured, pure Java database with a very small footprint (2MB), looks very promising  on small devices. I tried running it on the latest phoneME advanced (JavaME CDC) platform and could not resist the excitement of putting the details together in this blog. The procedure is very straight forward.

Prepare your setup as below, 

1. Get the latest phoneME advanced platform. Currently, it is supported only on Linux-x86 platform.
2. Get the latest JavaDB release.
3. You also need the JDBC Optional package library for CDC platform. It can be built from the source using the step by step instructions.

Now, try following on your linux box,

<CDC_HOME>/bin/cvm -Xbootclasspath/a:<JDBC_OP>/foundation_jdbc.jar 
-cp <JAVADB_HOME>/lib/derby.jar:<JAVADB_HOME>/lib/derbytools.jar
-Dij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource
-Dij.dataSource.databaseName=sample
-Dij.dataSource.createDatabase=create
org.apache.derby.tools.ij

Note here that the JDBC Op package can also be built along with CDC binaries, as mentioned here. then, Xbootclasspath need not be specifed while running. By default, the CDC build does not include JDBC Op package, hence we include it in our example.

Please note that, JSR 169, The JDBC Optional package does not support java.sql.Driver. So, the 'ij' cannot be used in its typical form to connect to database via a JDBC driver. The connection in this case is established using the JDBC DataSource.

This will bring up the íj prompt. 'ij' provides Command Line Interface to interact with a database using SQL. You may create such connection directly from your ME application using DataSource objects. You can try some simple steps like below to further test this setup.

ij> create table t (id int not null, addr varchar(20));
0 rows inserted/updated/deleted
ij> insert into t values (1, 'PlanetSun');
1 row inserted/updated/deleted
ij> select \* from t;
ID         |ADDR                
--------------------------------
1          |PlanetSun           
1 row selected
ij> exit;


Any database that may have been created by desktop Java application can be read/modified on JavaME platform and the same database can be used by the desktop application again. This can be accomplished so easily only with Java-JavaDB combination!

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/btclasses.zip:<CDC_HOME>/lib/basis.jar -d <pathtoclasses> java/sql/\*.java

4.3 <JDK1.4.x>/bin/javac -bootclasspath <CDC_HOME>/lib/btclasses.zip:<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!

About

user13377336

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
Bookmarks
Blogroll

No bookmarks in folder