Writing NDEFMessages

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

Writing NDEFMessages

by avives@ihg.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I'm playing with an example that tries to write a new NDEFMessage to a card. Everything works fine until the writeNDEF method on the NDEFTagConnection class is used. No reaction at all, the code snippet is as follows:

try {
        conn.writeNDEF(newMessage);
        form.append("new message written: "+msg+"\n");
} catch (ContactlessException e) {
        log("ContactlessException: "+e.getMessage());
        form.append("ContactlessException: "+e.getMessage());
} catch (IOException e) {
        log("IOException: "+e.getMessage());
        form.append("IOException: "+e.getMessage());
} catch (SecurityException  e) {
        log("SecurityException : "+e.getMessage());
        form.append("SecurityException : "+e.getMessage());
} catch (Exception  e) {
        log("Exception : "+e.getMessage());
        form.append("Exception : "+e.getMessage());
}

I got no exception neither any message. I'm doing the same test writing the same NDEFMessage that I read and got the same result.

Does anyone succed in writing NDEFMessages?

Thanks

Re: Writing NDEFMessages

by avives@ihg.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello again,

I went one step further and now I'm facing a new problem. A securityException is thrown with the message: "Required permission does not exist: Check JSI implementation"
On the sun webpage I found out that writing to NDEF requires an specific permission called: javax.microedition.contactless.ndef.NDEFTagConnection.write. The permission is added into the JAD and the application signed but still got the same error.

Does anyone know the right permission to use? Or there is a problem with the T80?

Thanks

Re: Writing NDEFMessages

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Is your MIDlet signed? If it, did you downloaded your MIDlet from an OTA server?

Best regards,

Jose

Re: Writing NDEFMessages

by avives@ihg.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, it is signed and works as a signed midelt as no permissions are asked to the user.

Is not downloaded form a OTA service. Is it necessary?

Thanks

Re: Writing NDEFMessages

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Well, it should not be necessary to use the OTA but, for instance, accessing to the secure element the midlet must to be signed and we got problems with the permits, but the midlet was successly installed through OTA. We are using a certificate from Verisign.

Greetings,

Jose

Re: Writing NDEFMessages

by avives@ihg.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Jose,

The thing is that I'm not accessing the secure element, I'm just trying to write a message to an external NFC Forum card.

Thanks

Re: Writing NDEFMessages

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have also tested this functionality in my side, the device reacts to the tag existing in the field but it doesn't executes the function to write in the tag. This MIDlet works in other devices. I will report this issue to BenQ.

Sorry the inconvenience,

Jose

Re: Writing NDEFMessages

by avives@ihg.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the information.

By the way, what is the best approach to start playing around with secure elements and OTA services? I know quite well the theory but I haven't started with the practice.

Any help would be appreciated.

Thanks.


Re: Writing NDEFMessages

by josergc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

If you install a signed MIDlet in the T80, no problem, but if you are configuring some NFC features in the .JAD, you will need the OTA server.

Don't worry, it starts with the user downloading the .JAD file, and then if the user agrees to download the .JAR, the URL is taken from the .JAD file. So it is easy to implement by oneself.

Greetings,

Jose

Re: Writing NDEFMessages

by avives@ihg.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi again,

This is perhaps an unrelated question, however I would appreciate your help. I failed to find a page on the Toro website where ask for more information, so I'm using this forum.

Is there any more information about Toro products? detailed product description, a brochure, anything.

Thanks.