Sign in to follow this  

JSCL 1.2.2 to MIDP 2.0

This topic is 4209 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Say if I'm porting an application from a japanese phone to a Nokia or SE phone, (The Japanese phone supports JSCL 1.2.2, while the Nokia/SE phone supports MIDP 2.0.) Certain JSCL methods like copyFullScreen createCharacterCommand DeviceControl drawBackground PhrasePlayer setPalette setPattern are not supported on MIDP 2.0. What is the best way out to solve this cross platform compatibility problem?

Share this post


Link to post
Share on other sites
The Japanese API of JSCL 1.2 translated by Babelfish

http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=ja_en&trurl=http%3a%2f%2fsakura.meijo-u.ac.jp%2fjava%2fvodafone-vappli-p5%2findex-all.html

Share this post


Link to post
Share on other sites
There really are no magic tricks here. You have to find MIDP 2.0 methods and/or classes that have similar functionality as the proprietary code. You might have to take some things out since not all the functionality might be available (for instance, I see the DeviceControl class has things like battery state and information position that have no equivalent in MIDP 2.0).

The documentation you linked has some hard to understand Engrish, so I can't say for sure, but here's some general direction of where to look for replacements:
* Graphics, Image, and Sprite classes for the graphic methods.
* The MMAPI (javax.microedition.media.* package) for sound. Specifically the Player class to replace PhrasePlayer.
* Display and GameCanvas classes for some of DeviceControl's methods (vibration, full screen, etc.).

shmoove

Share this post


Link to post
Share on other sites
Thanks, the advice was very helpful.

With regards to PhraseTrackListener, there doesn't seem to be anything similar to it. I do not know what implications there would be if I just remove the PhraseTrackListener from the midlet, is there anyone who can give sound advice?

The translation from Babelfish gives:

Public interface PhraseTrackListener
PhraseTrackListener is interface in order to mount the listener who expects the Summary of method
void eventOccurred(int event)
Occurrence of event.
event from the phrase sequencer.


Details of method

EventOccurred
Public void eventOccurred(int event)
Occurrence of event.
Parameter:
event -: Event classification (-1: Playback end, -2: Loop, -3: Halt, 0 or more: User event)

Share this post


Link to post
Share on other sites
What about the PlayerListener interface? Sounds like a good fit.

shmoove

Share this post


Link to post
Share on other sites
Ok still trying out the various stuff as the way they implement it is kinda different...

For Nokia/SE, there's the KeyCode to detect KeyPress. The Jap phone uses byte code to replace the KeyCode.

For example,

private boolean KeyCheck( int type, int fk ) //Method

if( KeyCheck( 0x02, ( 0x00000004 | 0x00001000 ) ) ){ //Check for KeyPress

Can't seem to find where they store the KeyCode as there's no KeyPress function.

[Edited by - aRcTiC_sTaR on July 11, 2006 2:18:39 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this