See you thread entry
Yesterday, 07:24
for test with Nokia 6131 NFC
with entry
ndef:external_rtd?name=urn:nfc:ext:nokia.com:id","mobileServer","*"
push ok
with entry
ndef:external_rtd?name=urn:nfc:ext:nokia.com:li:id","mobileServer","*"
push with error
Illegall Argument java/lang/IllegalArgumentException with Invalid Parameter
mariosas;331316
See you thread entry
Yesterday, 07:24
for test with Nokia 6131 NFC
with entry
ndef:external_rtd?name=urn:nfc:ext:nokia.com:id","mobileServer","*"
push ok
nope...this give "Invalid parameter"![]()
Mhm?!
Pushentry with
ndef:external_rtd?name=urn:nfc:ext:nokia.com:id
in the real device = no problem.
And
push with
ndef:external_rtd?name=urn:nfc:ext:nokia.com:li:id
= no problem
all entry in the .jad file, install and start = no problem.
im self testing = no problem.
I have no TAG (external_rtd) for the next testing for autolaunch.
in realdevice with
= no problemCode:MIDlet-1: mobileS RFID,/icons/logo24.png,Midlet MIDlet-Jar-Size: 16350 MIDlet-Jar-URL: 6131NFC.jar MIDlet-Name: mobileS RFID MIDlet-Permissions: javax.microedition.io.Connector.http, javax.microedition.io.PushRegistry, javax.microedition.contactless.DiscoveryManager, javax.microedition.io.Connector.ndef, javax.microedition.io.Connector.rf, javax.microedition.io.Connector.sc MIDlet-Push-1: ndef:rtd?name=urn:nfc:wkt:RFID_TAG,RFIDReader,* MIDlet-Push-2: ndef:rtd?name=urn:nfc:wkt:NDEF_TAG,RFIDReader,* MIDlet-Push-3: ndef:rtd?name=urn:nfc:wkt:ISO14443_CARD,RFIDReader,* MIDlet-Push-4: ndef:rtd?name=urn:nfc:wkt:T,RFIDReader,* MIDlet-Push-5: ndef:rtd?name=urn:nfc:wkt:U,RFIDReader,* MIDlet-Push-6: ndef:rtd?name=urn:nfc:wkt:St,RFIDReader,* MIDlet-Push-7: ndef:mime?name=text/uri-list,RFIDReader,* MIDlet-Push-8: ndef:mime?name=text/x-uri,RFIDReader,* MIDlet-Push-9: ndef:external_rtd?name=urn:nfc:ext:nokia.com:li:id,RFIDReader,* MIDlet-Vendor: XXXX MIDlet-Version: 0.6.4 MicroEdition-Configuration: CLDC-1.1 MicroEdition-Profile: MIDP-2.0
The next to last entry said, goes not. But I have the positive suppl.-smooth-eat now the entry.
I deleted and then again installed the old ' Midlet ' only.
Last edited by mariosas; 2007-08-20 at 12:06.
Pujanzi, Thanks a lot, finally a post that made some sense for newbies!
I finally got this thing working.
Juan C. Ramirez
Hi,
I just got started with the 6131 NFC emulator. I'm having issues with PushRegistry auto-start. There's a chance that I'm trying in the wrong direction. Here's what I'm doing:
1. I write to the MF1K tag in the emulator, with a separate MIDlet, with the following code:
I have a target listener registered as:
and in the targetDetected method:Code:dm.addTargetListener(this, TargetType.NDEF_TAG);
Then I right click the MF1K and press "Save Data", then plug it out, and close the emulator.Code:conn = (NDEFTagConnection)connector.open(properties[0].getUrl()); NDEFRecord[] records = new NDEFRecord[] {new NDEFRecord( new NDEFRecordType(NDEFRecordType.EXTERNAL_RTD, "urn:nfc:ext:yourcompany.com:pushexample"), null, null)}; NDEFMessage message = new NDEFMessage(records); conn.writeNDEF(message);
2. Secondly, I open the MIDlet to be auto-started via the emulator, which has the following code in it:
The "nfc:ndef;type=mf1k;uid=58db93b0" is obtained via the properties[0].getUrl() in the first tag writer MIDlet.Code:PushRegistry.registerConnection( "ndef:external_rtd?name=urn:nfc:ext:yourcompany.com:pushexample", "com.TestMidlet", "nfc:ndef;type=mf1k;uid=58db93b0");
Then I close this MIDlet by pressing the red "No" button in the emulator, and connect the MF1K by double clicking it, but nothing happens.
What is wrong, any ideas?
I read this thread and finally the task to launch a midlet by touching a tag works fine. Thanks for all your help here!
But now I have another task which is almost similar:
Is it possible to autostart one midlet from one midlet, which is running, by touching a tag?
In detail:
- I have an open running midlet
- then I touch a tag and in this moment another midlet should
launch
Is that possible to perform?
Thanks for all ideas and help!
urn:nfc:ext:yourcompany.comushexample
in emulator?
Emulator not realdevice!!!
you code
see you entryCode:PushRegistry.registerConnection("ndef:external_rtd?name=urn:nfc:ext:yourcompany.com:pushexample", "com.TestMidlet", "nfc:ndef;type=mf1k;uid=58db93b0");
-> 2007-08-20 11:55
statically registry entry in name.jad
UID those is all the sameCode:MIDlet-Push-9: ndef:external_rtd?name=urn:nfc:ext:nokia.com:li:id,RFIDReader,*
first test for all UID und check this for autolaunch.
AND see you extra entry
2007-08-07 08:24
OR
check you new entry with in the last codeCode:try { PushRegistry.registerConnection("ndef:external_rtd?name=","mobileServer","*"); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
Code:PushRegistry.registerConnection("ndef:external_rtd?name=urn:nfc:ext:yourcompany.com:pushexample", "com.TestMidlet", "nfc:ndef;type=mf1k;uid=58db93b0");
Hi, I'm currently doing a final year project using NFC 6131 Handset. It's my first time developing a mobile application and furthermore using NFC handset. Currently my school has provided my with NFC 6131 Handset and 6 NFC tag and I'm facing problem on auto launching application.Code:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.sg.np.ict.ryhmes; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.io.PushRegistry; import javax.microedition.contactless.*; import javax.microedition.contactless.ndef.*; /** * @author Administrator */ public class StartTour extends MIDlet implements CommandListener,TargetListener,NDEFRecordListener,ItemCommandListener{ private Form mScreen,duke,np; private ImageItem img,img2; private Command exitC,backC; private boolean autoLaunched=true; private NDEFMessage lastNDEF; private Displayable current; public TT(){ mScreen = new Form("Welcome");//creates form exitC = new Command("Exit",Command.EXIT,1);//creates command mScreen.addCommand(exitC);//add commands to screen mScreen.setCommandListener(this);//set listener for commands StringItem launchBtn = new StringItem(null,"Application installed. Please flash your phone over tag again. "); //launchBtn.setLayout(Item.LAYOUT_NEWLINE_AFTER); launchBtn.setPreferredSize(130, 200); launchBtn.setLayout(Item.LAYOUT_CENTER|Item.LAYOUT_2); launchBtn.setFont(Font.getFont(Font.FONT_STATIC_TEXT,Font.STYLE_PLAIN,Font.SIZE_SMALL)); launchBtn.setItemCommandListener(this); mScreen.append(launchBtn);//add button to screen //try saving tag id for auto launching of application try{ DiscoveryManager dm = DiscoveryManager.getInstance(); dm.addTargetListener(this,TargetType.NDEF_TAG); dm.addTargetListener(this,TargetType.RFID_TAG); dm.addNDEFRecordListener(this, new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD, "urn:nfc:wkt:T")); } catch(Exception ce) { System.err.println(); } } public void startApp() { //Register for push launch try{ String [] regConnections = PushRegistry.listConnections(false); boolean registered = false; for (int i = 0; i < regConnections.length; i++) { if(regConnections[i].equals("ndef:rtd?name=urn:nfc:wkt:T")) registered=true; } if(!registered) { PushRegistry.registerConnection("ndef:rtd?name=urn:nfc:wkt:T", "com.sg.np.ict.ryhmes.StartTour", "*"); } } catch(Exception e) { System.err.println(); } current = Display.getDisplay(this).getCurrent(); if(current==null) { Display.getDisplay(this).setCurrent(mScreen); } else { Display.getDisplay(this).setCurrent(current); } } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void targetDetected(TargetProperties[]prop) { if(prop[0].getUid().toString().equalsIgnoreCase("044f7cb9c00280")) { destroyApp(false); notifyDestroyed(); } else if(prop[0].getUid().toString().equalsIgnoreCase("044f52b9c00280")) { NP(); }else if(prop[0].getUid().toString().equalsIgnoreCase("044f63b9c00280")) { Duke(); } } public void recordDetected(NDEFMessage msg) { if(autoLaunched) { autoLaunched=false; if(msg!=null) { NDEFRecord[] records = msg.getRecords(); if(records !=null) { for(int i = 0; i<records.length; i++) { if(records.length>1) { } else{ } lastNDEF = msg; } } else{ } } else{ } } } public void commandAction(Command cmd, Displayable d) { if(cmd==backC) { Display.getDisplay(this).setCurrent(mScreen); } else if(cmd==exitC) { destroyApp(false); notifyDestroyed(); } } public void commandAction(Command cmd, Item i) { } public void NP(){ np = new Form("NP"); exitC = new Command("Exit",Command.EXIT,2); np.addCommand(backC); np.setCommandListener(this); try{ img2 = new ImageItem(null,Image.createImage("/NP_logo.gif"),ImageItem.LAYOUT_CENTER,"NP"); np.append(img2); } catch(Exception e) { System.err.println(); } Display.getDisplay(this).setCurrent(np); } public void Duke(){ duke = new Form("Duke"); backC = new Command("Back",Command.EXIT,2); duke.addCommand(backC); duke.setCommandListener(this); try{ img = new ImageItem(null,Image.createImage("/duke.jpg"),ImageItem.LAYOUT_CENTER,"Duke"); duke.append(img); } catch(Exception e) { System.err.println(); } Display.getDisplay(this).setCurrent(duke); } }
Situation upon running application, the phone would request to tap the tag again to allow auto launch but in my case it's not working
I have no idea how do i enable to make the tag run upon touch, but previously with the similar code i can't with multiple attempt but after i run the TagTestMidlet sample, the phone started to auto launch my application...
Can anyone mind explaining? im using the similar code i post below
Good mornings.
Check the nokia device for disable NFC function.
change code form dynamic entry to static entrys in the jad-file for the autolaunch with to all UID.
Change code to simple RFID Reader with run ..... with only TargetListener.
testversion - minimum code for testings with RFID Tag's for autolaunch and not more.
Later change code to Final Version with you code.
use try and error method.
device start and autolaunch with midlet self = Not possible.
reference: delete app from the device and then new install new version of app for the test.
Best Regards Mario
Hi Ferrychia,
I am also working on NFC as my final year project. Can yu pls let me know how yu solved the autostart problem? Does it mean the connection used on the emulator will be different from that of real device?
Thank you.
Sylv
As far as I'm concerend the Emulator does not support the Auto-Launch/PushReg feature on tag-touch, as it also does not support OTA deploying. (Please let me know if I'm wrong ...)
Cheers, Gerald
Hello everybody,
I am a new one n developing an application for NFC enabled devices.
I want to start my application as soon as external Tag is brought close to the device and it must ask User_Code before entering into the application.
Kindly let me know step by step as i have mentioned that I m beginner in this field.
Thanx in advance