title: How to get the phone number from a vcard
body: <p>I am using cardme library to deal with vcards. Following is my code</p>
  
  <pre><code>package vcardtest;
  
  import java.io.*;
  import java.util.Iterator;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  import net.sourceforge.cardme.engine.VCardEngine;
  import net.sourceforge.cardme.vcard.VCard;
  import net.sourceforge.cardme.vcard.features.EmailFeature;
  import net.sourceforge.cardme.vcard.features.NameFeature;
  import net.sourceforge.cardme.vcard.features.NicknameFeature;
  import net.sourceforge.cardme.vcard.features.TelephoneFeature;
  import net.sourceforge.cardme.vcard.types.parameters.TelephoneParameterType;
  
  public class VCardTest 
  {
  
      public static void main(String[] args) 
      {
          File vcardFile = new File("C:/Users/yohan/Contacts/Yohan Weerasinghe.vcf");
          VCardEngine vcardEngine = new VCardEngine();
          try 
          {
              VCard vcard = vcardEngine.parse(vcardFile);
              String name = vcard.getName().getGivenName();
  
              EmailFeature email = vcard.getEmails().next();
              String sEmail = email.getEmail();
  
              NicknameFeature nickName = vcard.getNicknames();
              Iterator&lt;String&gt; nicknames = nickName.getNicknames();
              String sNickName = nicknames.next();
  
              Iterator&lt;TelephoneFeature&gt; telephoneNumbers = vcard.getTelephoneNumbers();
              TelephoneFeature next = telephoneNumbers.next();
  
              String telephone = "";
  
  
                  while(vcard.getTelephoneNumbers().hasNext())
                  {
                      TelephoneFeature next1 = vcard.getTelephoneNumbers().next();
                      telephone = next1.getTelephone();
  
  
  
                      System.out.println(telephone);
                  }
  
  
  
              Iterator&lt;TelephoneParameterType&gt; telephoneParameterTypes = next.getTelephoneParameterTypes();
              TelephoneParameterType next1 = telephoneParameterTypes.next();
              String type = next1.getType();
  
              TelephoneParameterType next2 = telephoneParameterTypes.next();
              String type2 = next2.getType();
  
  
              System.out.println( name );
              System.out.println(sEmail);
              System.out.println(sNickName);
  
              System.out.println(type);
              System.out.println(type2);
  
  
          } catch (IOException ex) 
          {
             ex.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>However, there is no method called getNumber() or something. How can I get the mobile numbers and land numbers? Please help!</p>
  
  <p>NOTE: I UPDATED THE CODE. In there, you can see I managed to get the phone number. But, this returns only the HOME phone and not anything else. Even the loop is not stopping. Please help!</p>