×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    18

    Angry Reading URL from tag

    Hi,
    I am trying to read url from tag than launch browser. when phone touch to tag, it detects and read url automatically than launch browser. I read similar threads but i am lost I wrote these codes. Can you give idea ? What else do i need to add ?
    Code:
    public main() {
            exitCommand = new Command("Exit", Command.EXIT, 1);
            form = new Form("NFC-Research.at: UID Reader");
            form.addCommand(exitCommand);
            form.append("Touch Tag to read ID.");
            form.setCommandListener(this);
            // Registration of the TargetListener for external contactless
            
            try {
                DiscoveryManager dm = DiscoveryManager.getInstance();
                dm.addTargetListener(this, TargetType.NDEF_TAG);
              
                DiscoveryManager.getInstance().addNDEFRecordListener(this,  new NDEFRecordType(NDEFRecordType.NFC_FORUM_RTD, "urn:nfc:wkt:SP"));
                      
            } catch (ContactlessException ce) {
                displayAlert("Unable to register TargetListener: " + ce.toString(), AlertType.ERROR);
            }
          public void targetDetected(TargetProperties[] properties) {
           TargetType[]  iData = new TargetType[4]; // Types
            Class[] iConnectionName = new Class[properties.length];
            String iMessage = new String();
            for(int i = 0 ; i < properties.length ; i++)
            {         
                 iMessage += "TargetTyp:";
                 iData = properties[i].getTargetTypes(); 
                 for (int i1=0;i1<iData.length;i1++)
                 {
                      iMessage += "Nummer "+i1+" ("+iData[i1].toString()+")\n";                // typelist  
                  }                        
                  iMessage += "getURL(\n"+properties[i].getUrl()+")\n";  // URL from TAG     
                  iConnectionName = properties[i].getConnectionNames(); // with Interface 
                  iMessage +="ConnectionNames:";
                  for (int i2=0;i2<iConnectionName.length;i2++)
                  {
                       iMessage += "Nummer "+i2+" ("+iConnectionName[i2].toString()+")\n";
                 } 
                  }  }
            public void recordDetected(NDEFMessage arg0) {
    		// TODO Auto-generated method stub
    		
    	}
    
        }

  2. #2
    Registered User
    Join Date
    Dec 2010
    Posts
    18

    Re: Reading URL from tag

    I am sorry , I posted same thread two times wrongly :/
    And I solved problem

Similar Threads

  1. Readin URL from tag
    By nfce in forum Near Field Communication
    Replies: 1
    Last Post: 2010-12-25, 21:38
  2. Reading plain text from RFID tag
    By DixieFlatline in forum Near Field Communication
    Replies: 1
    Last Post: 2010-08-31, 10:28
  3. e71x javascript/object tag does not work with a URL
    By ajpugliese in forum General Development Questions
    Replies: 0
    Last Post: 2009-11-17, 17:25
  4. Write url NDEF message to tag
    By Alex_Polt in forum Near Field Communication
    Replies: 6
    Last Post: 2007-10-28, 15:02
  5. 6131, Tag reading and Permissions
    By lionel.jive in forum Near Field Communication
    Replies: 3
    Last Post: 2007-04-27, 13:17

Posting Permissions

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