I want to implement a function in my MIDlet, that will allow to search in JAVA documents for an API to obtain the IMEI and other identification information (like a DM can do). How can I do this?

One thought on “I want to implement a function in my MIDlet, that will allow to search in JAVA documents for an API to obtain the IMEI and other identification information (like a DM can do). How can I do this?

  1. Normal
    0

    MicrosoftInternetExplorer4

    You can use:

        
    import com.motorola.oem.OEMException;
         import com.motorola.oem.osc.OSC;
         import com.motorola.oem.osc.OSCException;

                               
                IMEI
    =
    OSC.getProperty("oem.hw.imei");                            

                if(IMEI
    != null)        

               
    {

                         
    System.out.println("IMEI number: " + IMEI);

                }       

     

    The method is (Java doc):

    getProperty

    public static final
    java.lang.String getProperty(java.lang.String key)

                                             
    throws
    OSCException

    Gets system’s
    property value indicated by the specified key.

    (For available keys
    refer to the device’s USER GUIDE).

    Parameters:

    key – Property’s name.

    Returns:

    The string value of
    the property, or
    null if there is no property with that key

     

     

    Throws:

    java.lang.NullPointerExceptionkey
    is
    null.

    java.lang.IllegalArgumentException – if key
    is empty.

    OSCException – The key is invalid
    (GET_PROPERTY_KEY_NOT_FOUND_ERROR, error code 100)
    Value retrieving has failed (GET_PROPERTY_VALUE_OF_KEY_CANT_BE_RETRIEVE_ERROR,
    error code 101)

     

    You can also check
    the JAVA user guide: 6.2.3 OSC Package