Java 为什么赢了';Zooz支付代码不会出现在我的Android应用程序中吗?

Java 为什么赢了';Zooz支付代码不会出现在我的Android应用程序中吗?,java,android,eclipse,methods,payment,Java,Android,Eclipse,Methods,Payment,我想将Zooz的支付应用程序与我的Android应用程序集成,但Zooz不会出现。没有给出或声明错误,但当我在模拟器或手机上运行应用程序时,它不会显示。应用程序运行时就像代码不在那里一样。我知道我的问题很广泛,但由于日志中没有关于Zooz的错误,也没有红色的x,我无法确定具体的问题。应用程序没有崩溃,只是正常运行。有人能帮我找出原因吗,或者为什么Zooz不会出现?我正在尝试使用Zooz,以便可以购买菜单中的项目 下面是我用来集成代码的参考。一般来说,我对Java非常陌生。我放置了SDK库并按照步

我想将Zooz的支付应用程序与我的Android应用程序集成,但Zooz不会出现。没有给出或声明错误,但当我在模拟器或手机上运行应用程序时,它不会显示。应用程序运行时就像代码不在那里一样。我知道我的问题很广泛,但由于日志中没有关于Zooz的错误,也没有红色的x,我无法确定具体的问题。应用程序没有崩溃,只是正常运行。有人能帮我找出原因吗,或者为什么Zooz不会出现?我正在尝试使用Zooz,以便可以购买菜单中的项目

下面是我用来集成代码的参考。一般来说,我对Java非常陌生。我放置了SDK库并按照步骤进行操作,但什么都没有出现

我尝试过的事情:

我尝试过取出库并删除对Zooz的所有引用,然后从一开始就将其放回。我试着用手工编写代码,而不是从PDF中一步一步地复制粘贴。我已经检查了log cat以查找Zooz的任何引用,但没有结果,并且该应用程序在我的模拟器和设备上都运行。我已经检查了我的引用库,例如,当我点击a.class时,它显示:JAR文件zooz_iap_1.4.4.6.JAR没有源附件。但这并不是一个错误。我应该尝试附加源吗?(我还没有)再说一次,我是Android新手,我不确定它到底意味着什么,我不想无限期地毁掉一切。我已尝试使用发票步骤和不使用发票集成步骤运行代码。我不确定它是否是可选的,因为它没有指定。我也试着打电话给Zooz客户服务部,但没有人接办公室电话和手机。有人能帮我找出这个问题吗

这是我目前正在使用的代码,以备参考

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<?> 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<?> 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 & 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<?> parent) {
            }

        });

        registerForContextMenu(carousel);
    }

}
package com.carouseldemo.main;
导入android.app.Activity;
导入android.content.Intent;
导入android.net.Uri;
导入android.os.Bundle;
导入android.util.Log;
导入android.view.ContextMenu;
导入android.view.ContextMenu.ContextMenuInfo;
导入android.view.Menu;
导入android.view.MenuItem;
导入android.view.view.OnClickListener;
导入android.view.MenuInflater;
导入android.view.view;
导入android.webkit.WebView;
导入android.widget.ImageView;
导入android.widget.TextView;
导入android.widget.Toast;
导入android.widget.FrameLayout;
导入com.carouseldemo.controls.Carousel;
导入com.carouseldemo.controls.CarouselAdapter;
导入com.carouseldemo.controls.CarouselAdapter.AdapterContextMenuInfo;
导入com.carouseldemo.controls.CarouselAdapter.OnItemClickListener;
导入com.carouseldemo.controls.CarouselAdapter.OnItemSelectedListener;
导入com.carouseldemo.controls.CarouselItem;
导入com.powersourceinternational.main.R;
导入com.zooz.android.lib.CheckoutActivity;
公共类MainActivity扩展了活动{
私有静态最终字符串标记=null;
私有静态final int ZooZ_Activity_ID=0;
@凌驾
公共布尔值onContextItemSelected(MenuItem项){
int id=item.getItemId();//您知道单击了哪个菜单
int imageId=-1;
开关(id){
案例1:
imageId=R.drawable.productone;
打破
案例2:
imageId=R.drawable.product2;
打破
案例3:
imageId=R.drawable.product1;
打破
案例4:
imageId=R.drawable.product3;
打破
案例5:
imageId=R.drawable.product4;
打破
案例6:
imageId=R.drawable.product5;
打破
案例7:
imageId=R.drawable.product6;
打破
案例8:
imageId=R.drawable.product7;
打破
案例9:
imageId=R.drawable.product8;
打破
案例90:
imageId=R.drawable.Product9和Half;
打破
案例91:
imageId=R.drawable.product10;
打破
案例10:
imageId=R.drawable.chevy1;
打破
案例11:
imageId=R.drawable.nissanleaf;
打破
案例12:
imageId=R.drawable.honda;
打破
案例13:
imageId=R.drawable.prius;
打破
案例14:
imageId=R.drawable.tesla;
打破
案例15:
imageId=R.drawable.porsche;
打破
案例16:
imageId=R.drawable.fordfocus;
打破
案例166:
imageId=R.drawable.bmw;
打破
案例167:
imageId=R.drawable.fordc;
打破
案例168:
imageId=R.drawable.fisker;
打破
//…其他ID也一样
}
ImageView弹出窗口=新的ImageView(此);
setOnClickListener(新的OnClickListener(){
@凌驾
公共void onClick(视图v){
((FrameLayout)findviewbyd(android.R.id.content))
.移除视图(v);
}
});
//设置图像
popup.setImageResource(imageId);
((FrameLayout)findviewbyd(android.R.id.content)).addView(弹出窗口);
返回super.onContextItemSelected(项目);
}
@凌驾
公共布尔onCreateOptions菜单(菜单){
super.onCreateOptions菜单(菜单);
MenuInflater充气机=getMenuInflater();
充气机。充气(R.menu.testmenu2,菜单);
//你的代码。。。
返回true;
}
单击鼠标左键时的公共无效(视图v){
//创建新的意向签出活动
意向意向=新意向(此为CheckoutActivity.class);
//提供应用程序密钥
intent.putExtra(签出活动)。
ZOOZ_应用程序_键,“b8d0ff11-c