title: Bitly to shorten url java / android
body: <p>I am shortening a url using bitlyj library by following this sample.</p>
  
  <p>To get My api key: i register for a free account on bitlyj official website.</p>
  
  <p>Then i follow this link <a href="http://bitly.com/a/your_api_key" rel="nofollow">http://bitly.com/a/your_api_key</a> to get my api key. </p>
  
  <p>Here's my implementation.</p>
  
  <pre><code>import com.rosaloves.bitlyj.Url;
  import static com.rosaloves.bitlyj.Bitly.*;
  
  Url url = as("bitlyapidemo", 
  "MY_API_KEY").call(shorten("http://rosaloves.com/stories/view/13"));
  String ul = url.getShortUrl();
  System.out.println("art bitfly:"+ url);
  </code></pre>
  
  <p>When i run this sample i got this error. </p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{….. com.rosaloves.bitlyj.BitlyException: INVALID_APIKEY
  </code></pre>
  
  <p>a help please ?</p>