title: Why StringUtils Apache class is not recognized in Android?
body: <p>Why <strong>import org.apache.commons.lang.StringUtils</strong> cannot be imported in android by default.</p>
  
  <p>Do i have to include an external library? Then where can i find that library on the web?</p>
  
  <pre><code>package com.myapps.urlencoding;
  
  import android.app.Activity;
  import org.apache.commons.lang.StringUtils;
  
  public class EncodeIdUtil extends Activity {
      /** Called when the activity is first created. */
       private static Long multiplier=Long.parseLong("1zzzz",36);
  
          /**
           * Encodes the id.
           * @param id the id to encode
           * @return encoded string
           */
          public static String encode(Long id) {
              return StringUtils.reverse(Long.toString((id*multiplier), 35));
          }
  
          /**
           * Decodes the encoded id.
           * @param encodedId the encodedId to decode
           * @return the Id
           * @throws IllegalArgumentException if encodedId is not a validly encoded id.
           */
          public static Long decode(String encodedId) 
              throws IllegalArgumentException {
              long product;
              try {
                  product = Long.parseLong(StringUtils.reverse(encodedId), 35);
              } catch (Exception e) {
                  throw new IllegalArgumentException();
              }
              if ( 0 != product % multiplier || product &lt; 0) {
                  throw new IllegalArgumentException();
              }
              return product/multiplier;
          }
  }
  </code></pre>