×

Discussion Board

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

    Exclamation Readin URL from tag

    Hi ,
    I am trying reading url from tag. When phone touch to tag, it detects tag automatically and read url than launch browser. Is it possible ? I read similar threads in this forum but i am lost I wrote these codes. Can you fix it ? What else i have 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) {
    				
    	}

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

    Re: Readin URL from tag

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

Similar Threads

  1. Reading URL from tag
    By nfce in forum Near Field Communication
    Replies: 1
    Last Post: 2010-12-25, 21:39
  2. 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
  3. Lookup device type for tag as rss feed tag
    By sim0nha in forum Symbian
    Replies: 7
    Last Post: 2009-07-13, 09:29
  4. Readin from very big .bmp file
    By jascco in forum Symbian Media (Closed)
    Replies: 7
    Last Post: 2008-05-15, 09:38
  5. Write url NDEF message to tag
    By Alex_Polt in forum Near Field Communication
    Replies: 6
    Last Post: 2007-10-28, 15:02

Posting Permissions

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