Midlet autostart question

View: New views
6 Messages — Rating Filter:   Alert me  

Midlet autostart question

by Zec54 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey,

I have a question. I wish to know how the MIDlet was started, manually or by touching the appropriate tag.
I tried with the following code(it works on Nokia 6131NFC)..

DiscoveryManager dm = DiscoveryManager.getInstance();
if (dm.getProperty("LaunchType").toLowerCase().equals("manual"))
{
  getDisplay().setCurrent(screen1);
}
else
{
  getDisplay().setCurrent(screen2);
}

...and it doesn't matter how the midlet is started, it always shows the screen1.

I have also tried with puting the flag in recordDetected method and got the same result as above.
So how can one determine the way the midlet was started?

Regards,
Samo

Re: Midlet autostart question

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It seems like manual we got from Sirit does not say anything about the 'LaunchType' property. Before to say this feature is not developed, I am going to send an email to out contact in BenQ to try to know more details.

Re: Midlet autostart question

by Zec54 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, thanx Jose. I guess we will have to wait for the BenQ guys to reply...
A have another question. When the midlet is started by touchnig the tag, is the content of the tag read or do I have to touch the tag again to read its content? If it is read with the first touch, how can I get the data from the tag without touching it again?

Oh, and this manual from Sirit you mentioned, is this the "JSR257 with Extensions - BenQ Integration Guide-02d.pdf" document, which comes with SDK? If not, is it possible to get this manual?

Cheers,
Samo

Re: Midlet autostart question

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Samo,

In the tests I have made, the content is read and don't need to tap again the tag. Check if the static method
com.sirit.nfc.Hardware.NFCRequestEnabledADD(true);
is called in the constructor of your MIDlet. Otherwise, I may not work properly.

Yes, the "JSR257 with Extensions - BenQ Integration Guide-02d.pdf" is the manual of Sirit and comes with the SDK. If you have not received, just ask me and we are going to send a copy as soon as possible.

Best regards,

Jose

Re: Midlet autostart question

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Samo,

I got reply from BenQ, they said BenQ doesn’t support “LaunchType” property manager.

Best regards,

Jose

Re: Midlet autostart question

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Samo,

Thanks for your patience, there is the answer from BenQ:

This is not a JSR257 property and it is not available for the T80 and the emulator. This is “Nokia 6131NFC” proprietary behavior. In the T80 the only way to know if a MIDlet was started by Push OR manually is to use the listConnections API of the PushRegistry passing TRUE in parameter. Here a snipped code to how to do:

 

protected void startApp() {

           

            //Check if the startup has been due to an incoming data.

        String connections[] = PushRegistry.listConnections(true);

 

        if (connections.length > 0) {

            // MIDlet started by a push connection

            System.out.println(" STARTED BY PUSH ENTRY AVAILABLE : connections = "+connections[0]);          

        } else {

           // There are not any pending data, but open the connection for later use.

           connections = PushRegistry.listConnections(false);

           if (connections.length > 0) {

              System.out.println(" STARTED MANUALLY ");  

           }

       }

}