title: Integrating stripe with android app
body: <p>I am trying to support stripe payments from my android application but it won't run.  Is the java incompatible? My code and errors are below:</p>
  <pre><code>package io.noq.kiosk.android;
  
  import java.util.HashMap;
  import java.util.Map;
  import com.stripe.Stripe;
  import com.stripe.exception.APIConnectionException;
  import com.stripe.exception.AuthenticationException;
  
  import com.stripe.exception.CardException;
  import com.stripe.exception.InvalidRequestException;
  import com.stripe.exception.StripeException;
  import com.stripe.model.Charge;
  
  import io.noq.android.R;
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  
  public class OnSwipeActivity extends Activity {
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          Stripe.apiKey = &quot;the secret (intentionally omitting)&quot;;
          Map&lt;String, Object&gt; chargeMap = new HashMap&lt;String, Object&gt;();
  
          chargeMap.put(&quot;amount&quot;, 100);
          chargeMap.put(&quot;currency&quot;, &quot;usd&quot;);
  
          Map&lt;String, Object&gt; cardMap = new HashMap&lt;String, Object&gt;();
          cardMap.put(&quot;number&quot;, &quot;4242424242424242&quot;);
          cardMap.put(&quot;exp_month&quot;, 12);
          cardMap.put(&quot;exp_year&quot;, 2013);
          chargeMap.put(&quot;card&quot;, cardMap);
  
          try {
              Charge charge = Charge.create(chargeMap);
              System.out.println(charge);
              Log.i(&quot;Status is: &quot; + &quot;exiting try onCreate-PayActivity&quot;, &quot;let's see what goes out....&quot;);
              System.out.println(&quot;Status is: &quot;+ &quot;exiting try onCreate-PayActivity&quot;);
          } catch (CardException e) {
              // Since it's a decline, CardException will be caught
              System.out.println(&quot;CardException is: &quot; + e.getCode());
              System.out.println(&quot;CardException is: &quot; + e.getParam());
              Log.i(OnSwipeActivity.class.getName(), &quot;e.getCode() ....&quot; + e.getCode());
          } catch (InvalidRequestException e) {
              // Invalid parameters were supplied to Stripe's API
              System.out.println(&quot;InvalidRequestException: &quot; + e.getMessage());
              Log.i(OnSwipeActivity.class.getName(),&quot;e.getCode() ....&quot; + e.getCause());
          } catch (AuthenticationException e) {
              // Authentication with Stripe's API failed (maybe you changed API keys recently)
              System.out.println(&quot;AuthenticationException: &quot; + e.getMessage());
              Log.i(OnSwipeActivity.class.getName(), &quot;e.getCode() ....&quot; + e.getCause());
          } catch (APIConnectionException e) {
              // Network communication with Stripe failed
              System.out.println(&quot;APIConnectionException: &quot; + e.getMessage());
              Log.i(OnSwipeActivity.class.getName(), &quot;e.getCode() ....&quot; + e.getCause());
          } catch (StripeException e) {
              // Display a very generic error to the user, and maybe send yourself an email
              System.out.println(&quot;StripeException: &quot; + e.getMessage());
              Log.i(OnSwipeActivity.class.getName(), &quot;e.getCode() ....&quot; + e.getCause());
          } catch (Exception e) {
              // Something else happened, completely unrelated to Stripe
              System.out.println(&quot;Exception: &quot; + e.getMessage());
              Log.i(OnSwipeActivity.class.getName(), &quot;e.getCode() ....&quot; + e.getCause());
          }
      }
  }
  </code></pre>
  <p>These are the errors:</p>
  <blockquote>
  <p>12-25 05:34:22.625: W/dalvikvm(801): threadid=1: thread exiting with uncaught exception    (group=0x40a70930)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801): FATAL EXCEPTION: main</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801): java.lang.NoClassDefFoundError                           com.stripe.Stripe</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at io.noq.kiosk.android.OnSwipeActivity.onCreate(OnSwipeActivity.java:26)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.app.Activity.performCreate(Activity.java:5104)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.app.ActivityThread.access$600(ActivityThread.java:141)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.os.Handler.dispatchMessage(Handler.java:99)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.os.Looper.loop(Looper.java:137)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at android.app.ActivityThread.main(ActivityThread.java:5039)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at java.lang.reflect.Method.invokeNative(Native Method)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at java.lang.reflect.Method.invoke(Method.java:511)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)</p>
  <p>12-25 05:34:22.647: E/AndroidRuntime(801):     at dalvik.system.NativeStart.main(Native Method)</p>
  </blockquote>