×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    48

    detect if a midlet is launched through push registry.

    Hi all,

    I have developed a midlet that can be launched through push registry (Static Registration) or if the user presses its icon. Is there a way (a command) to know in which way was it launched?


    Thanks in advance!

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: detect if a midlet is launched through push registry.

    Quote Originally Posted by millansf View Post
    Hi all,

    I have developed a midlet that can be launched through push registry (Static Registration) or if the user presses its icon. Is there a way (a command) to know in which way was it launched?



    Thanks in advance!
    The PushRegistry.listConnections() method allows you to discover all the inbound connections registered by the MIDlet suite. You can also use it to discover whether the MIDlet was activated by an incoming connection.

    If you pass false to listConnections(), the method returns a string array that identifies all the inbound connections registered by the MIDlet suite, but if you pass a true argument the method reports only the registered connections with available data - indicating that MIDlet activation was due to incoming network data . Let's look at a method that uses listConnections() to discover whether the MIDlet was push-activated, and that processes each push connection individually.

    PHP Code:
    /**
    *  Determine if activated due to inbound connection and
    *  if so dispatch a PushProcessor to handle incoming
    *  connection(s). @return true if MIDlet was activated
    *  due to inbound connection, false otherwise
    */
    private boolean handlePushActivation() {
        
    //  Discover if there are pending push inbound
        //  connections and if so, dispatch a
        //  PushProcessor for each one.
        
    String[] connections =
        
    PushRegistry.listConnections(true);
        if (
    connections != null && connections.length 0) {
        for (
    int i=0connections.lengthi++) {
            
    PushProcessor pp = new
            
    PushProcessor(connections[i]);
        }
        return(
    true);
        }
        return(
    false);

    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    48

    Re: detect if a midlet is launched through push registry.

    Thank you very much Raj! I will try

Similar Threads

  1. Replies: 4
    Last Post: 2009-07-10, 12:07
  2. Is there any way to find application launched by user or push registry.
    By mmdfarook in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2008-06-11, 12:54
  3. Push Registry SMS doesn't work until MIDlet launched manually once.
    By TimJohns in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-02-28, 18:48
  4. launching a midlet using push registry
    By araja in forum Symbian
    Replies: 2
    Last Post: 2007-10-05, 09:29
  5. push registry midlet (hidden)
    By farhanx in forum Mobile Java General
    Replies: 2
    Last Post: 2006-10-24, 11:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×