Skip to main content

Recompiling midp/romizing the files/sip protocol integration to j2me

  • From: Jean Deruelle <jean.deruelle@...>
  • To: dev@...
  • Subject: Recompiling midp/romizing the files/sip protocol integration to j2me
  • Date: Thu, 8 Sep 2005 13:52:04 +0200
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=XqAszKt3ZU0bLcQtp0MCPR/642p3RyYKJ63OCZaQfYmtiRLUSZIvdg/338qyvto1pyEz8cJk1nIjMXSwNkzMzRXgS1IJNmDjnKPzrKHL+pgnkXY9ICTgD8rpgXEEnG+wU7P3DFzg5kzrN70qyoyaVXugOvkhHAG/IBe+8MGeIhE=
  • Mailing-list: contact dev-help@...; run by ezmlm

Here is some information in recompiling MIDP
tested only Win2000, not tried on Linux/Unix.

Tools used:
- MVC C++ 6.0 (utilize really only the c-compiler/linker there)
- cygwin bash
- zip.exe, unzip.exe (just normal comp/decompressors in the
$path)
- j2sdk1.4.2_04

SUN source files, unzip under same directory
- j2me_cldc-1_0_4-src-winunix.zip (note this is CLDC1.0.4)
- midp-2_0-src-windows-i686.zip

(1) Building the MIDP.exe:
Change these paths in the makefile:
       midp2.0fcs/build/win32/kvm/Platform.gmk

       KVM_DIR = ....j2me_cldc
       MIDP_DIR=....midp2
.0fcs
        // (note only relative paths worked for us)

Build the midp.exe in bash shell in directory
        midp2.0fcs/build/win32/kvm
with command
       make ALT_BOOTDIR=c:/j2sdk.1.4.2_04 midp
       // (note your Java SDK is defined here)

The new midp.exe is written under midp2.0fcs/build/win32/kvm/bin
that should be copied under midp2.0fcs/bin before running it
there.

(2) Adding your own classes and rebuilding:
Let's say you have your implementation under com.nist.sip
(or something similar)

Add your own source files (com/nist/sip and interfaces
javax/microedition/sip)
under here:
       midp2.0fcs/src/share/classes/

Add com.nist.sip package in MIDP makefile definitions in
       midp2.0fcs /build/share/makefiles/Defs.gmk
Note! javax.microedition.sip not needed since it is already
under javax.

MIDP_DEF_SOURCE:=$(shell find \
         $(MIDP_DIR)/src/share/classes/java \
         $(MIDP_DIR)/src/share/classes/javax \
         $(MIDP_DIR)/src/share/classes/com/sun/mmedia \
         $(MIDP_DIR)/src/share/classes/com/nist/sip \
         $(MIDP_DIR)/src/share/classes/com/sun/midp \
         -name '*.java' | egrep -v
'midp/ssl|$(MIDP_EXCLUDE_CLASSES)')

Just recompile.

The new classes are now romized inside the midp.exe as an
extension
to the MIDP library. Added classes can be also seen in the file
       midp2.0fcs/build/win32/kvm/classes.zip

------------------------------------------------------------------------

Other things:

- the MIDP environment need to always be recompiled when
system classes or integrated libraries are added to it
regardless of changing (or not) the exisiting source files.
- In MIDP/CLDC platform extending the system by adding
(.jar) files in classpath does not work. That is a security
issue.
- Now if one don't want to touch the Connector class in
CLDC, one may consider adding following kind of wrapper
class in path
        com/sun/midp/io/j2me/sip

package com.sun.midp.io.j2me.sip;

import java.io.*;
import javax.microedition.io.*;
import com.sun.midp.io.* ;
public class Protocol implements
com.sun.cldc.io.ConnectionBaseInterface {
   /**
    *
    * @param name       the target for the connection
    * @param mode       I/O access mode
    * @param timeouts   a flag to indicate that the caller
wants
    *                   timeout exceptions
    *
    * @return client or server SIP connection
    *
    * @exception  IOException  if an I/O error occurs.
    * @exception  ConnectionNotFoundException  if the host
cannot be connected
    *              to
    * @exception  IllegalArgumentException  if the name is
malformed
    */
   public Connection openPrim(String name, int mode,
boolean timeouts)
       throws IOException {

       // Here you initialize your own SIP implementation,
which
                       // either implements interface
SipClientConnection or SipConnectionNotifier
                       // depending on the opening URI e.g.
                       //              sip:user@...
  -> SipClientConnection
                       //              sip:5060
                                   -> SipConnectionNotifier
                       //
                       // Note that the parameters 'mode'
and 'timeouts' are meaningless
                       // in JSR180 spec.
   }
 }

Best regards,
Jean Deruelle


Recompiling midp/romizing the files/sip protocol integration to j2me

Jean Deruelle 09/08/2005
 
 
Close
loading
Please Confirm
Close