I am still having problems getting PushRegistry to work completely on 6212 Classic via static registration via JAD file after MIDlet download.
I'd like the user to be able to download it, and not have to run it, and then have it auto-start on touching the appropriate tag. I understand this should be possible and what the JAD method is for.
I'd like to explain here some discoveries that might help others, and see if anyone know what can fix my problem. That means a long post :-(
I have already studied these threads in the developer forums and wiki articles without solving my problems:
- PushRegistry example (http://wiki.forum.nokia.com/index.ph...detect_example)
- Sun explanation: http://developers.sun.com/mobility/m...icles/pushreg/
I have got some things to work using the MIDlet to programatically register for PushRegistry, but would like static registration via the JAD file.
NOTE: I complied and ran the PushReg example code (written and tested on 6131?) from the wiki and it does NOT work for me on 6212....I have inspected it's JAD and it matches the example text, so I'm pretty sure it's not my code or JAD file, and is maybe something in my phone config or build settings?
In NetBeans I edit the Push Registry entry "Edit Push Registry Entry" dialog thus:
- class = com.bcntouch.shopper.Shopper
- sender IP (filter?) = *
- Connection String = ndef:external_rtd?name=urn:nfc:ext:bcntouch.com:shopper
which shows up in JAD file (correctly in my understanding) as:
This matches the format of the NDEFPush example code, which produces:
Also the MIDlet has code to register itself programatically in the AMS using this code:
PushRegistry.registerConnection("ndef:external_rtd?name=urn:nfc:ext:bcntouch.com:shopper", "com.bcntouch.shopper.Shopper", "*");
which matches the above.
Deploy MIDlet to phone using Nokia PC Suite method via netbeans.
Won't auto-start using JAD entry when a correctly written tag is touched.
The phone reports "Unknown service type".
When I run the code manually once and it programmatically registers itself, then if I exit MIDlet and touch the tag it DOES work.
So, auto-start is working, just not after MIDlet download using the static registration via the JAD file.
Off course, the programatic registration is removed any time I update the MIDlet, and since the static one doesn't work I always have to manually run MIDlet, at least once.
I discovered that if you change the auto-start application settings for the MIDlet in Apps->Collection folder after downloading it (but NOT running it), it then seems to auto-start correctly (without it having to be run and do the programmatic registration).
But, if then if the MIDlet is updated it stops working.
So, for now I always need a manual process - either starting the app once, or changing the setting in the menus for that application. Then it will auto-start.
But that kinda defeats the purpose of auto-start and isn't what I'd like to do for the users.
BTW 6212 Emulator auto-start
Ironically, I have been able to get it to work on the emulator....
You need to force OTA loading of the MIDlet via the Tools->Preferences->MIDP tab in the emulator.
This Installs any MIDlets ran into the emultor.
If you then load the MIDlet in the emulator, but say "no" and not run it, it can be auto-started with an appropriately formatted tag.
So for now is working better for me than the handset. This makes me wonder if I have the same problem on the handset, that somehow I need to make the handset validate it using JAM/AMS for it to work, and that is what fidling with the settings on the phone does?
Reading NDEF on auto-start
Last but not least....when I change the manual settings and get the MIDlet to be autostarted with an NFC tag.
IT SEEMS (difficult to debug!) that the recordDetected() method is NOT called, it's just a standard MIDlet start-up.
1) How can I get a MIDlet auto-started using JAD static registration on 6212 Classic?
2) How can I make the recordDetected() method get called with the NDEF message on the start-up?
This currently doesn't seem to happen even when I have programattically registered the MIDlet and
it is auto-started.
Many thanks to anyone who helps.