title: Why won't the Zooz payment code show up in my Android App?
body: <p>I want to integrate Zooz's payment application with my Android App, however, Zooz will not show up. There are no errors given or stated, but when I run the app on the emulator or my phone it will not show up. The app runs as if the code is not there. I know my question is broad, but with no errors about Zooz given in the log cat and no red x's, I can't identify the specific problem. The app does not crash, it just operates as normal. Can someone please help me identify the cause of this, or why Zooz will not show up? I am attempting to use Zooz so items from my menu can be purchased.</p>
  
  <p>Here is the reference I used to integrate the code. I am very new to Java in general. I placed the SDK libraries and followed the steps and nothing comes up.</p>
  
  <p><a href="https://app.zooz.com/portal/PortalController?cmd=resources" rel="nofollow">https://app.zooz.com/portal/PortalController?cmd=resources</a></p>
  
  <p>Things I have tried:</p>
  
  <p>I have tried taking out the libraries and deleting all references to Zooz and then placing it back in from the start. I have tried hand writing the code instead of copy pasting from PDF step by step guide. I have checked the log cat for any references to Zooz to no avail, and the app runs on both my emulator and device. I have checked my references library, which when I click on a.class for example it says: The JAR file zooz_iap_1.4.4.6.jar has no source attachment. But it does not come up as an error. Should I try to attach a source? (I haven't yet.) Again, I am new to Android and I'm unsure of what it means exactly, I don't want to ruin things indefinitely. I have tried to run the code with the invoice step and without the invoice integration step. I am unsure if it is optional or not, as it does not specify. I have also tried calling Zooz customer service but no one answer's the office phone nor the mobile phone. Can someone help me to identify the problem?</p>
  
  <p>Here is the code I am currently using, just in case it is needed for reference.</p>
  
  <pre><code>package com.carouseldemo.main;
  
  import android.app.Activity;
  import android.content.Intent;
  
  import android.net.Uri;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.ContextMenu;
  import android.view.ContextMenu.ContextMenuInfo;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View.OnClickListener;
  
  import android.view.MenuInflater;
  import android.view.View;
  import android.webkit.WebView;
  import android.widget.ImageView;
  import android.widget.TextView;
  import android.widget.Toast;
  import android.widget.FrameLayout;
  import com.carouseldemo.controls.Carousel;
  import com.carouseldemo.controls.CarouselAdapter;
  import com.carouseldemo.controls.CarouselAdapter.AdapterContextMenuInfo;
  import com.carouseldemo.controls.CarouselAdapter.OnItemClickListener;
  import com.carouseldemo.controls.CarouselAdapter.OnItemSelectedListener;
  import com.carouseldemo.controls.CarouselItem;
  import com.powersourceinternational.main.R;
  import com.zooz.android.lib.CheckoutActivity;
  
  public class MainActivity extends Activity {
  
      private static final String TAG = null;
      private static final int ZooZ_Activity_ID = 0;
  
      @Override
      public boolean onContextItemSelected(MenuItem item) {
          int id = item.getItemId(); // you know which menu is clicked
          int imageId = -1;
          switch (id) {
          case 1:
              imageId = R.drawable.productone;
              break;
          case 2:
              imageId = R.drawable.product2;
              break;
          case 3:
              imageId = R.drawable.product1;
              break;
          case 4:
              imageId = R.drawable.product3;
              break;
          case 5:
              imageId = R.drawable.product4;
              break;
          case 6:
              imageId = R.drawable.product5;
              break;
          case 7:
              imageId = R.drawable.product6;
              break;
          case 8:
              imageId = R.drawable.product7;
              break;
          case 9:
              imageId = R.drawable.product8;
              break;
          case 90:
              imageId = R.drawable.product9andhalf;
              break;
          case 91:
              imageId = R.drawable.product10;
              break;
          case 10:
              imageId = R.drawable.chevy1;
              break;
          case 11:
              imageId = R.drawable.nissanleaf;
              break;
          case 12:
              imageId = R.drawable.honda;
              break;
          case 13:
              imageId = R.drawable.prius;
              break;
          case 14:
              imageId = R.drawable.tesla;
              break;
          case 15:
              imageId = R.drawable.porsche;
              break;
          case 16:
              imageId = R.drawable.fordfocus;
              break;
          case 166:
              imageId = R.drawable.bmw;
              break;
          case 167:
              imageId = R.drawable.fordc;
              break;
          case 168:
              imageId = R.drawable.fisker;
              break;
  
          // ...the same for the other ids
          }
          ImageView popup = new ImageView(this);
          popup.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  ((FrameLayout) findViewById(android.R.id.content))
                          .removeView(v);
              }
          });
          // set the image
          popup.setImageResource(imageId);
          ((FrameLayout) findViewById(android.R.id.content)).addView(popup);
          return super.onContextItemSelected(item);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          super.onCreateOptionsMenu(menu);
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.testmenu2, menu);
          // your code...
          return true;
  
      }
  
      public void onCheckoutClick(View v) {
          // create new intent CheckoutActivity
          Intent intent = new Intent(this, CheckoutActivity.class);
          // supply app-key on the intent
          intent.putExtra(CheckoutActivity.
          ZOOZ_APP_KEY, "b8d0ff11-c60b-400d-82a0-0ed694e238b0");
          // supply transaction details (amount, currency)
          intent.putExtra(CheckoutActivity.
          ZOOZ_AMOUNT, 33.5);
          intent.putExtra(CheckoutActivity.
          ZOOZ_CURRENCY_CODE, "USD");
          // supply environment mode (sandbox or production)
          intent.putExtra(CheckoutActivity.
          ZOOZ_IS_SANDBOX, true);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent
      data) {
      if (requestCode == ZooZ_Activity_ID) {
      switch (resultCode) {
      case Activity.RESULT_OK:
      Log.i(TAG, "Succefuly paid. Your transaction id is: " +
      data.getStringExtra(CheckoutActivity.
      ZOOZ_TRANSACTION_ID));
      break;
      case Activity.RESULT_CANCELED:
      if (data != null)
      Log.e(TAG, "Error, cannot complete payment with ZooZ."  + "Error code: " +
      data.getIntExtra(CheckoutActivity.ZOOZ_ERROR_CODE
      , 0) + "; Error Message: " +
      data.getStringExtra(CheckoutActivity.ZOOZ_ERROR_MSG));
      break; 
      }
      }
      }
  
  
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          WebView webView;
          // int id = item.getItemId();
          // int imageId = -1;
          switch (item.getItemId()) {
  
          case R.id.item1:
  
              Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                      Uri.parse("http://www.powersourceinternational.com/"));
              startActivity(browserIntent);
  
              return true;
  
          case R.id.item2:
              webView = (WebView) findViewById(R.id.webview);
              webView.getSettings().setJavaScriptEnabled(true);
              webView.loadUrl("https://www.facebook.com/PowerSourceInternational");
  
              // imageId = R.drawable.hippo;
              // WebView wv2 = (WebView) findViewById(R.id.webview);
              // wv2.loadUrl("file:///android_asset/resume_page2.html");
              return true;
  
          case R.id.item3:
              webView = (WebView) findViewById(R.id.webview);
              webView.getSettings().setJavaScriptEnabled(true);
              webView.loadUrl("https://twitter.com/EnergyPSI");
  
              return true;
  
          case R.id.item4:
              webView = (WebView) findViewById(R.id.webview);
              webView.getSettings().setJavaScriptEnabled(true);
              webView.loadUrl("http://pinterest.com/energypsi/");
  
              return true;
  
          }
  
          return false;
      }
  
      // true if you want the menu to be displayed; false otherwise
  
      @Override
      public void onCreateContextMenu(ContextMenu menu, View v,
              ContextMenuInfo menuInfo) {
          // Just prepare ourself for unexpected arguments...
  
          if (menuInfo == null) {
              return;
          }
          if (!(menuInfo instanceof AdapterContextMenuInfo)) {
              return;
          }
  
          AdapterContextMenuInfo mi = (AdapterContextMenuInfo) menuInfo;
          // to identify the view according to this case values you could assing
          // ids like this:
          // case 0:
          // menu.add(Menu.NONE, 1, Menu.NONE, "menu title");
          // menu.add(Menu.NONE, 2, Menu.NONE, "menu title");
          // menu.add(Menu.NONE, 3, Menu.NONE, "menu title");
          // menu.add(Menu.NONE, 4, Menu.NONE, "menu title");
          // etc
          // case 1:
          // menu.add(Menu.NONE, 1001, Menu.NONE, "menu title");
          // menu.add(Menu.NONE, 1002, Menu.NONE, "menu title");
          // menu.add(Menu.NONE, 1003, Menu.NONE, "menu title");
          // menu.add(Menu.NONE, 1004, Menu.NONE, "menu title");
          // etc
          // case 2:
          // menu.add(Menu.NONE, 2001, Menu.NONE, "menu title");
          // menu.add(Menu.NONE, 2002, Menu.NONE, "menu title");
          // etc
          // this way the ids will be unique and in the onContextItemSelected
          // method you'll be able to
          // identify the current case(0, 1, 2, 3, 4, 5) and the id clicked
          switch (mi.position) {
          case 0:
              menu.add(Menu.NONE, 0, Menu.NONE, "Products");
              menu.add(Menu.NONE, 1, Menu.NONE, "EV2430WS Wall   $1200.00");
              menu.add(Menu.NONE, 2, Menu.NONE, "EV230WSR 3R Wall $1800.00");
              menu.add(Menu.NONE, 3, Menu.NONE, "EV Parking Sign $65.00");
              menu.add(Menu.NONE, 4, Menu.NONE, "Pedestal 1 Outdoor $3000.00");
              menu.add(Menu.NONE, 5, Menu.NONE, "Pedestal 2 Outdoor $4600.00");
              menu.add(Menu.NONE, 6, Menu.NONE, "CT500 Wall Mount $2665.00");
              menu.add(Menu.NONE, 7, Menu.NONE, "CT2020 Family $6500.00");
              menu.add(Menu.NONE, 8, Menu.NONE,
                      "DC Fast Charge CHAdeMO $35000.00");
              menu.add(Menu.NONE, 9, Menu.NONE,
                      "The Power Share: Call for pricing");
              menu.add(Menu.NONE, 90, Menu.NONE, "Solar Canopy one-car $13500.00");
              menu.add(Menu.NONE, 91, Menu.NONE, "Solar Canopy Two car $18500.00");
              break;
          case 1:
              menu.add(Menu.NONE, 900, Menu.NONE, "Top Ten Fuel Efficient Cars");
              menu.add(Menu.NONE, 10, Menu.NONE, "Chevrolet Volt");
              menu.add(Menu.NONE, 11, Menu.NONE, "Nissan Leaf");
              menu.add(Menu.NONE, 12, Menu.NONE, "Honda");
              menu.add(Menu.NONE, 13, Menu.NONE, "Toyota Prius");
              menu.add(Menu.NONE, 14, Menu.NONE, "Tesla");
              menu.add(Menu.NONE, 15, Menu.NONE, "Porsche");
              menu.add(Menu.NONE, 16, Menu.NONE, "Ford Focus");
              menu.add(Menu.NONE, 166, Menu.NONE, "BMW");
              menu.add(Menu.NONE, 167, Menu.NONE, "Ford C");
              menu.add(Menu.NONE, 168, Menu.NONE, "Fisker");
              break;
          case 2:
              menu.add(Menu.NONE, 17, Menu.NONE, "About Us");
              menu.add(Menu.NONE, 18, Menu.NONE, "Our solution includes the following:");
              menu.add(Menu.NONE, 19, Menu.NONE, "Comprehensive Energy Assessment");
              menu.add(Menu.NONE, 20, Menu.NONE, "Energy Sustainability Strategy");
              menu.add(Menu.NONE, 21, Menu.NONE, "Energy Solutions Design");
              menu.add(Menu.NONE, 22, Menu.NONE, "Solutions Implementation");
              menu.add(Menu.NONE, 23, Menu.NONE, "Savings Verification Process");
              menu.add(Menu.NONE, 24, Menu.NONE, "Engery Solutions Development");
              break;
          case 3:
              menu.add(Menu.NONE, 25, Menu.NONE, "Consulting");
              menu.add(Menu.NONE, 26, Menu.NONE, "Residential Site Survey: $250");
              menu.add(Menu.NONE, 27, Menu.NONE, "Residential Energy Consulting: $250");
              menu.add(Menu.NONE, 28, Menu.NONE, "Commercial Consulting: $1000");
              menu.add(Menu.NONE, 29, Menu.NONE, "Energy Efficiency Site Audit: $500");
              menu.add(Menu.NONE, 30, Menu.NONE, "Electric Vehicle Consulting: $250");
              menu.add(Menu.NONE, 31, Menu.NONE, "Commercial Vehicle Consulting $500");
              menu.add(Menu.NONE, 32, Menu.NONE, "Industrial Battery Bank: $500");
              menu.add(Menu.NONE, 321, Menu.NONE, "EVSE Inspection $75.00/hr. $150 Fee");
              break;
          case 4:
              menu.add(Menu.NONE, 33, Menu.NONE, "Leasing");
              menu.add(Menu.NONE, 34, Menu.NONE, "Single Wall Mounted Unit");
              menu.add(Menu.NONE, 35, Menu.NONE, "Unit ID: EV230WSR");
              menu.add(Menu.NONE, 36, Menu.NONE, "2 Year Plan: $148.00");
              menu.add(Menu.NONE, 37, Menu.NONE, "3 Year Plan: $103.00");
              menu.add(Menu.NONE, 38, Menu.NONE, "5 Year Plan: $78.00");
              menu.add(Menu.NONE, 39, Menu.NONE, "Single Bollard Mounted Unit");
              menu.add(Menu.NONE, 40, Menu.NONE, "Unit ID: EV230PSR");
              menu.add(Menu.NONE, 401, Menu.NONE, "2 Year Plan: $242.00");
              menu.add(Menu.NONE, 403, Menu.NONE, "3 Year Plan: $168.00");
              menu.add(Menu.NONE, 404, Menu.NONE, "5 Year Plan: $115.00");
              menu.add(Menu.NONE, 405, Menu.NONE, "Double Bollard Mounted Unit");
              menu.add(Menu.NONE, 406, Menu.NONE, "Unit ID: EV230PDR");
              menu.add(Menu.NONE, 407, Menu.NONE, "2 Year Plan: $315.00");
              menu.add(Menu.NONE, 408, Menu.NONE, "3 Year Plan: $243.00");
              menu.add(Menu.NONE, 409, Menu.NONE, "5 Year Plan: $166.00");
              break;
          case 5:
              menu.add(Menu.NONE, 41, Menu.NONE, "Contact Us");
              menu.add(Menu.NONE, 42, Menu.NONE, "Phone: 678-951-0715");
              menu.add(Menu.NONE, 43, Menu.NONE,
                      "Address: 6065 Roswell Road, Suite 500, Atlanta, Georgia 30328 ");
              menu.add(Menu.NONE, 44, Menu.NONE,
                      "Website: Powersourceinternational.com");
              menu.add(Menu.NONE, 45, Menu.NONE,
                      "Email: powersourcevids@gmail.com ");
              menu.add(Menu.NONE, 46, Menu.NONE, "Fax: 678-951-8993");
              menu.add(Menu.NONE, 47, Menu.NONE,
                      "Facebook: https://www.facebook.com/PowerSourceInternational");
              menu.add(Menu.NONE, 48, Menu.NONE,
                      "Linkedin: http://www.linkedin.com/company/power-source-international");
              break;
          default:
              break;
          }
          super.onCreateContextMenu(menu, v, menuInfo);
      }
  
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          final Carousel carousel = (Carousel) findViewById(R.id.carousel);
          carousel.setOnItemClickListener(new OnItemClickListener() {
  
              public void onItemClick(CarouselAdapter&lt;?&gt; parent, View view,
                      int position, long id) {
                  CarouselItem item = (CarouselItem) parent.getChildAt(position);
  
                  // HERE: Force context menu
                  carousel.showContextMenuForChild(item);
                  Toast.makeText(
                          MainActivity.this,
                          String.format("%s has been clicked",
                                  ((CarouselItem) parent.getChildAt(position))
                                          .getName()), Toast.LENGTH_SHORT).show();
  
              }
  
              @Override
              public void onCreateContextMenu(ContextMenu menu, View v,
                      ContextMenuInfo menuInfo) {
  
                  // TODO Auto-generated method stub
  
              }
  
              @Override
              public boolean onCreateOptionsMenu(Menu menu) {
                  MenuInflater inflater = getMenuInflater();
                  inflater.inflate(R.menu.testmenu2, menu);
  
                  // TODO Auto-generated method stub
                  return true;
              }
  
              @Override
              public boolean onContextItemSelected(MenuItem item) {
                  // TODO Auto-generated method stub
                  return false;
              }
  
              @Override
              public boolean onOptionsItemSelected(MenuItem item) {
                  // TODO Auto-generated method stub
                  return false;
              }
  
          });
  
          carousel.setOnItemSelectedListener(new OnItemSelectedListener() {
  
              public void onItemSelected(CarouselAdapter&lt;?&gt; parent, View view,
                      int position, long id) {
  
                  final TextView txt = (TextView) (findViewById(R.id.selected_item));
  
                  switch (position) {
                  case 0:
                      txt.setText("The PSI Process was developed as a result of consulting methodologies and infrastructure training with companies like General Electric, MCI and IBM. The executives at PSI have over 80 years of combined experience in working with fortune 50 companies to deliver on time solutions that reduce cost. Our staff now has the ability to utilize more than two dozen proven approaches and technologies to provide long-term savings of up to 30% or more with fast project paybacks. That’s a promise we back up with an insurance policy underwritten by one of the world’s oldest A+ rated insurance companies to remove all financial risk from your decision to invest with our company.");
                      break;
                  case 1:
                      txt.setText("In an age when Energy-based Buzz-words abound, PSI works to make it simple as well as profitable for you our customer. All throughout our customer's environments, PSI efforts have produced positive results often beyond expectations. Whether you're looking at Materials environment, Public Installations, the Lodging Industry or Office Complex installations, PSI can effect cost saving benefits that will truly enhance your bottom line! Because each business is different and unique, let us come and show you how we can make our solutions work for you!");
                      break;
                  case 2:
                      txt.setText("Power Source International (PSI) is setting the pace for engineering and environmental companies for you, our customer. PSI evaluates each and every facet of your site, focused on providing energy sustainability solutions. By looking at all of the different areas, we are not trying for a “Home Run” but several smaller hits that provides you with an integrated winning vehicle to increase your bottom line &amp; your long-term competitive edge.");
                      break;
                  case 3:
                      txt.setText("PSI’s Executive Team has a broad based set of skills and experiences around consulting and implementation for industries in numerous sectors, including manufacturing, processing, transportation, healthcare, food and beverage,  hospitality, retail and government agencies. The Company has also teamed with leading companies in the solar, wind and energy management arena. The team is further supported by an internal Board of Advisors formed by professionals from research, universities and the private sector.");
                      break;
                  case 4:
                      txt.setText("Want to install an EV charging solution but don’t want to pay for it all at once? No problem! We have leasing options to fit almost every budget.");
                      break;
                  case 5:
                      txt.setText("If you would like more information from PSI, please fill in the form. For immediate assistance, please contact us at 678-951-0715.");
  
                      break;
                  }
  
              }
  
              public void onNothingSelected(CarouselAdapter&lt;?&gt; parent) {
              }
  
          });
  
          registerForContextMenu(carousel);
      }
  
  }
  </code></pre>