Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:55:37+00:00 2026-06-05T01:55:37+00:00

1 have added 1 jar API file. here is rest of the sample code

  • 0

1 have added 1 jar API file. here is rest of the sample code

i downloaded it from http://innovator.samsungmobile.com/cms/cnts/knowledge.detail.view.do?platformId=1&cntsId=9986&nacode=

i am getting error:


06-01 18:22:31.900: E/AndroidRuntime(24713): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.samsungapps.plasma.plasmatester/com.samsungapps.plasma.plasmatester.PlasmaTesterActivity}: java.lang.ClassNotFoundException: com.samsungapps.plasma.plasmatester.PlasmaTesterActivity in loader dalvik.system.PathClassLoader[/data/app/com.samsungapps.plasma.plasmatester-1.apk]

    public class PlasmaTesterActivity extends Activity implements PlasmaListener {
    private class ItemInformationListAdapter extends
            ArrayAdapter<ItemInformation> {

        public ItemInformationListAdapter(Context context,
                int textViewResourceId, ArrayList<ItemInformation> objects) {
            super(context, textViewResourceId, objects);

            __itemInformationList = objects;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View v = convertView;
            if (v == null) {
                LayoutInflater inflater = PlasmaTesterActivity.this
                        .getLayoutInflater();
                v = inflater.inflate(R.layout.row, null);
            }

            final ItemInformation pi = __itemInformationList.get(position);
            if (pi != null) {
                TextView tv1 = (TextView) v.findViewById(R.id.textView1);
                tv1.setText(pi.getItemName());
                TextView tv2 = (TextView) v.findViewById(R.id.textView2);
                tv2.setText(getPriceStringWithCurrencyUnit(pi));
                TextView tv3 = (TextView) v.findViewById(R.id.textView3);
                tv3.setText(pi.getItemDescription());
                Button b = (Button) v.findViewById(R.id.button1);
                b.setOnClickListener(new OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        __plasma.requestPurchaseItem(__transactionId++,
                                pi.getItemId());
                    }
                });
            }

            return v;
        }

        private ArrayList<ItemInformation> __itemInformationList = null;
    }

    private class PurchasedItemInformationListAdapter extends
            ArrayAdapter<PurchasedItemInformation> {

        public PurchasedItemInformationListAdapter(Context context,
                int textViewResourceId,
                ArrayList<PurchasedItemInformation> objects) {
            super(context, textViewResourceId, objects);

            __purchasedItemInformationList = objects;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View v = convertView;
            if (v == null) {
                LayoutInflater inflater = PlasmaTesterActivity.this
                        .getLayoutInflater();
                v = inflater.inflate(R.layout.row, null);
            }

            final PurchasedItemInformation pi = __purchasedItemInformationList
                    .get(position);
            if (pi != null) {
                TextView tv1 = (TextView) v.findViewById(R.id.textView1);
                tv1.setText(pi.getItemName());
                TextView tv2 = (TextView) v.findViewById(R.id.textView2);
                tv2.setText(getPriceStringWithCurrencyUnit(pi));
                TextView tv3 = (TextView) v.findViewById(R.id.textView3);
                tv3.setText(pi.getPaymentId());

                Button b = (Button) v.findViewById(R.id.button1);
                b.setVisibility(View.GONE);
            }

            return v;
        }

        private ArrayList<PurchasedItemInformation> __purchasedItemInformationList = null;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        __plasma = new Plasma(__ITEM_GROUP_ID, this);
        __plasma.setPlasmaListener(this);
        __plasma.setDeveloperFlag(1);

        ArrayList<ItemInformation> itemInformationList = new ArrayList<ItemInformation>();
        __itemInformationListAdapter = new ItemInformationListAdapter(this,
                R.layout.row, itemInformationList);

        ArrayList<PurchasedItemInformation> purchasedItemInformationList = new ArrayList<PurchasedItemInformation>();
        __purchasedItemInformationListAdapter = new PurchasedItemInformationListAdapter(
                this, R.layout.row, purchasedItemInformationList);

        ListView itemList = (ListView) findViewById(R.id.listView1);
        itemList.setAdapter(__itemInformationListAdapter);

        ListView purchaseList = (ListView) findViewById(R.id.listView2);
        purchaseList.setAdapter(__purchasedItemInformationListAdapter);

        Button getItemListButton = (Button) findViewById(R.id.button1);
        getItemListButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                __plasma.requestItemInformationList(__transactionId++, 1,
                        __ITEM_LIST_REQUEST_COUNT);
            }
        });

        Button getPurchaseListButton = (Button) findViewById(R.id.button2);
        getPurchaseListButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                __plasma.requestPurchasedItemInformationList(__transactionId++,
                        1, __ITEM_LIST_REQUEST_COUNT);
            }
        });
    }

    @Override
    public void onItemInformationListReceived(int transactionId,
            int statusCode, ArrayList<ItemInformation> itemInformationList) {
        switch (statusCode) {
        case Plasma.STATUS_CODE_SUCCESS:
            __itemInformationListAdapter.clear();
            for (int i = 0; i < itemInformationList.size(); i++) {
                ItemInformation itemInformation = itemInformationList.get(i);
                __itemInformationListAdapter.add(itemInformation);
            }
            __itemInformationListAdapter.notifyDataSetChanged();
            break;
        default:
            String errorMessage = "Failed to retrieve the item list";
            showErrorDialog(statusCode, errorMessage);
            break;
        }
    }

    @Override
    public void onPurchasedItemInformationListReceived(int transactionId,
            int statusCode,
            ArrayList<PurchasedItemInformation> purchasedItemInformationList) {
        switch (statusCode) {
        case Plasma.STATUS_CODE_SUCCESS:
            __purchasedItemInformationListAdapter.clear();
            for (int i = 0; i < purchasedItemInformationList.size(); i++) {
                PurchasedItemInformation purchasedItemInformation = purchasedItemInformationList
                        .get(i);
                __purchasedItemInformationListAdapter
                        .add(purchasedItemInformation);
            }
            __purchasedItemInformationListAdapter.notifyDataSetChanged();
            break;
        default:
            String errorMessage = "Failed to retrieve the purchase list";
            showErrorDialog(statusCode, errorMessage);
            break;
        }
    }

    @Override
    public void onPurchaseItemFinished(int transactionId, int statusCode,
            PurchasedItemInformation purchasedItemInformation) {
        AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);

        switch (statusCode) {
        case Plasma.STATUS_CODE_SUCCESS:
            StringBuilder purchasedItemInformationStringBuilder = new StringBuilder();
            purchasedItemInformationStringBuilder.append("Item name: ");
            purchasedItemInformationStringBuilder
                    .append(purchasedItemInformation.getItemName());
            purchasedItemInformationStringBuilder.append(__CR_LF);
            purchasedItemInformationStringBuilder.append("Item ID: ");
            purchasedItemInformationStringBuilder
                    .append(purchasedItemInformation.getItemId());
            purchasedItemInformationStringBuilder.append(__CR_LF);
            purchasedItemInformationStringBuilder.append("Payment ID: ");
            purchasedItemInformationStringBuilder
                    .append(purchasedItemInformation.getPaymentId());
            purchasedItemInformationStringBuilder.append(__CR_LF);
            purchasedItemInformationStringBuilder.append("Purchase date: ");
            purchasedItemInformationStringBuilder
                    .append(purchasedItemInformation.getPurchaseDate());

            purchasedItemInformationStringBuilder.append(__CR_LF);
            purchasedItemInformationStringBuilder.append("Price: ");
            purchasedItemInformationStringBuilder
                    .append(getPriceStringWithCurrencyUnit(purchasedItemInformation));

            alertDialogBuilder.setTitle("Purchase information");
            alertDialogBuilder.setMessage(purchasedItemInformationStringBuilder
                    .toString());
            alertDialogBuilder.show();
            break;
        case Plasma.STATUS_CODE_CANCEL:
            break;
        default:
            String errorMessage = "Failed to purchase the item";
            showErrorDialog(statusCode, errorMessage);
            break;
        }
    }

    private void showErrorDialog(int errorCode, String errorMessage) {
        String errorMessageWithCode = String.format("%s (%d)", errorMessage,
                errorCode);

        AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
        alertDialogBuilder.setTitle("Error");
        alertDialogBuilder.setMessage(errorMessageWithCode);
        alertDialogBuilder.show();
    }

    private String getPriceStringWithCurrencyUnit(
            ItemInformation itemInformation) {
        String priceStringFormatString = null;
        if (itemInformation.getCurrencyUnitHasPenny()) {
            priceStringFormatString = "%.2f";
        } else {
            priceStringFormatString = "%.0f";
        }

        String priceString = String.format(priceStringFormatString,
                itemInformation.getItemPrice());

        StringBuffer priceStringWithCurrencyUnitBuffer = new StringBuffer();
        if (itemInformation.getCurrencyUnitPrecedes()) {
            priceStringWithCurrencyUnitBuffer.append(itemInformation
                    .getCurrencyUnit());
            priceStringWithCurrencyUnitBuffer.append(priceString);
        } else {
            priceStringWithCurrencyUnitBuffer.append(priceString);
            priceStringWithCurrencyUnitBuffer.append(itemInformation
                    .getCurrencyUnit());
        }

        return priceStringWithCurrencyUnitBuffer.toString();
    }

    private ItemInformationListAdapter __itemInformationListAdapter = null;
    private PurchasedItemInformationListAdapter __purchasedItemInformationListAdapter = null;
    private int __transactionId = 0;
    private Plasma __plasma = null;

    private static final String __ITEM_GROUP_ID = "100000008752";
    private static final int __ITEM_LIST_REQUEST_COUNT = 15;
    private static final String __CR_LF = "\n";
}

and manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.samsungapps.plasma.plasmatester" android:versionCode="1"
    android:versionName="1.5">
    <uses-sdk android:minSdkVersion="7" />
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".PlasmaTesterActivity" android:label="@string/app_name"
            android:configChanges="orientation|keyboardHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:55:39+00:00Added an answer on June 5, 2026 at 1:55 am

    Did you put the jar in your libs folder? (You said you added it but not where/how).

    They recently changed requirements and they now need to go in the libs folder I mentioned above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the wordalignment in the BerkeleyAligner.jar file from http://code.google.com/p/berkeleyaligner/ in my
Here is my .classpath file, after I have added two more external jars (org.restlet.ext.simple.jar
I have added this jar file to my project's build path under libraries: http://sunet.dl.sourceforge.net/project/jeplite/jeplite/jeplite-0.8.7/jeplite-0.8.7a-src.jar
i have added google admob jar, have added jar file to builtpath and also
I am using apache http commons 4.I have added both httpcore-4.0.1.jar and httpclient-4.0.1.jar in
I downloaded an API but there is no jar file in it. It has
I'm have added external jar file to the libs folder of mt project and
Here is the java package-tree: http://docs.oracle.com/javase/7/docs/api/java/lang/package-tree.html I read a tutorial on Java which stated
I have added core jar file of ZXing according to post Integrating the ZXing
I have added a piece of sharepoint code to the existing java file which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.