title: How to get country code from mobile number using libphonenumber api in Android
body: <p>I am using libphonenumber api <a href="https://code.google.com/p/libphonenumber/" rel="nofollow">https://code.google.com/p/libphonenumber/</a> in android project, I am getting country code using following code</p>
  
  <pre><code>PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
  try {
         PhoneNumber numberProto = phoneUtil.parse(number, "IN");
         int countryCode = numberProto.getCountryCode();
        } catch (NumberParseException e) {
           System.err.println("NumberParseException was thrown: " + e.toString());
        }
  </code></pre>
  
  <p>My question is:-
   -- I have number like +447870000000 but don't know about country code but want to get country code from this number like +44  how can I get it through this api ?</p>
  
  <p>please help me
  Thanks in advance  </p>