FileDocCategorySizeDatePackage
CDCInit.javaAPI DocphoneME MR2 API (J2ME)3218Wed May 02 18:00:08 BST 2007com.sun.midp.main

CDCInit

public class CDCInit extends Object
Initialize the CDC environment for MIDlet execution.

Fields Summary
Constructors Summary
Methods Summary
public static voidinit(java.lang.String midpHome, java.lang.String nativeLib)
Performs CDC API initialization.

param
midpHome root directory of the MIDP working files
param
nativeLib name of the native shared library, only applies to non-rommized build

        try {
            if (nativeLib != null) {
                System.loadLibrary(nativeLib);
            }
        } catch (UnsatisfiedLinkError err) {
            /*
             * Since there is currenly no to determine if the build rommized
             * the MIDP native methods or not, it is customary to pass in a
             * default library name even if there is no library to load,
             * which will cause this exception, so the exception has to be
             * ignored here. If this is a non-rommized build and library is
             * not found, the first native method call below will throw an
             * error.
             */
        }

        /*
         * In case the normal system properites configration did not set
         * the profile set it here.
         */
        String profile = System.getProperty("microedition.profiles");
	if (profile == null) {
            System.setProperty("microedition.profiles", "MIDP-2.1");
        }

        initMidpNativeStates(midpHome);
    
public static voidinit()
Performs CDC API initialization.

	/*
         * Path to MIDP working directory. 
         * Default is the property "sun.midp.home.path",
         * the fallback is user.dir.
         */
        String userdir = System.getProperty("user.dir", ".");
        userdir+= File.separator + "midp" + File.separator + "midp_fb";
        String home = System.getProperty("sun.midp.home.path", userdir);
        String lib = System.getProperty("sun.midp.library.name", "midp");

        init(home, lib);
    
static native voidinitMidpNativeStates(java.lang.String home)
Performs native subsystem initialization.

param
home path to the MIDP working directory.