Sunday, April 22, 2007

JAVA 認證心得 -- SCMAD (7)

Push Registry

##CONTINUE##

  • SMS and CBS are the valid protocols that support by Push Registry.
  • Push Registry supports CBS protocol but filtering is not performed.
  • The Push entries in the JAD file should have contiguous numbers and any break in the numbering will result in the entries after the break being ignored by the application.
  • When an application is registered for the message via Push Registry but is not running, when the message is received by the device the AMS will receive the message, start the application, and then deliver the message to the application.
  • MIDP 2.0 defines socket and datagram connection types for PushRegistry.
  • A Push Registered application can be actived using a TCP/IP Socket connection(stream-based connections), UDP Datagram Connection, CBS(packet-based connections), or an SMS Connection(Message-based connections). è IN WMA spec
  • The ConnectionNotFoundException exception is thrown when a protocol specified in the connection string for a Push Registry entry is not supported by the device.
  • The PushRegistry.getFilter(String connection) retrieves the registered filter for a requested connection as specified in the AllowedSender attribute of a MIDlet-Push-n attribute in DD.
  • The following attributes MUST be present in the Application Descriptor (JAD) or the manifest file of the JAR of the application.

If error, not be installed!!
  • An application can register itself for an alarm using the registerAlarm(String class, long time).

    Ø The class should be a MIDlet in the currently running MIDlet suite which is to be notified.

    Ø Upon receipt of an event, the class will be notified after the time expires.

    Ø At most, only one alarm can be registered per registry entry.

    Ø The MIDlet must be registered in the descriptor or the manifest file.

    Ø the time parameter is obtained using the Date.getTime() method

  • Datagram and Socket support for Push Registry is optional.
  • For SMS messages, the push address is the phone’s number(and port)
  • Class PushRegistry
  • public static String[] listConnections(boolean available)

    Return a list of registered connections for the current MIDlet suite.

    Parameters:

    available - if true, only return the list of connections with input available, otherwise return the complete list of registered connections for the current MIDlet suite

    Returns:

    array of registered connection strings, where each connection is represented by the generic connection protocol, host and port number identification

  • public static long registerAlarm(String midlet, long time) throws ClassNotFoundException, ConnectionNotFoundException
  • public static void registerConnection(String connection, String midlet, String filter) throws ClassNotFoundException, IOException, ConnectionNotFoundException, IllegalArgumentException, SecurityException

Read more!

No comments: