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

  • SEARCH
  • Home
  • 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 7775487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:38:37+00:00 2026-06-01T17:38:37+00:00

I’m modifying an existing app. The app used Zxing’s barcode scanner through Java class

  • 0

I’m modifying an existing app. The app used “Zxing’s barcode scanner” through Java class and packages.

My project includes those packages:

com.google.zxing
com.google.zxing.integration
com.google.zxing.integration.android

I have a class with some code like this:

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;

public class QRdecoderActivity extends Activity {

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // temp = this;

        IntentIntegrator.initiateScan(this);
    }

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch(requestCode) {

            case IntentIntegrator.REQUEST_CODE: {

                if (resultCode != RESULT_CANCELED) {

                    IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);

                    if (scanResult != null) {
                        String upc = scanResult.getContents();

                        Toast.makeText(this, "Contents : " + upc, Toast.LENGTH_LONG).show();

                    }

                }
                finish();               

                break;
            }
        }
    }   
}

Everything is working fine, but when I start the testing process, I discover that I need to have the ” Barcode Scanner” App installed.

It thats right?.

I thought I did not need to have, if it using the Java Class inside my project.

How I can check if the App is installed? and How can I go to the “Google Play” and show it, to the user, from my code for download?

  • 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-01T17:38:38+00:00Added an answer on June 1, 2026 at 5:38 pm

    This has been discussed before and is extremely well documented at the Zxing website. While you can integrate the source into your app, you can also scan via intent.

    From what you posted, it looks like the source code has been integrated into the app, therefore you should not need it installed (as all the classes should be there).

    If you are being prompted to install the barcode scanner app, it sounds like scanning via intent is being used. The end result is that you have a cocktail of both approaches, where scanning via intent is the method being used.

    I, personally, prefer scanning via intent. This is documented here: http://code.google.com/p/zxing/wiki/ScanningViaIntent.

    My reasoning is that your app becomes independent of the bar code scanner. Any updates caused by new barcode standards or general bug fixes/improvements are made immediately available to the end user (as an update via Google Play), as they do not have to wait for your app to integrate any updated source code. Also, it is encouraged that you only use the source for Zxing if you plan to add value to it.

    How I can check if the App is installed? and How can I go to the
    “Google Play” and show it, to the user, from my code for download?

    Zxing provide the class to gracefully handle the situation where the user makes the intent and the Barcode Scanner app is not installed. It will take the user to the app on Google play directly. You can find it at http://code.google.com/p/zxing/source/browse/trunk/android-integration/src/com/google/zxing/integration/android/IntentIntegrator.java.

    Once you have the class, you simply need to call the following:

    IntentIntegrator integrator = new IntentIntegrator(yourActivity);
    integrator.initiateScan();
    

    and then add to your Activity

    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
      IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
      if (scanResult != null) {
        // handle scan result
      }
      // else continue with any other code you need in the method
      ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I am trying to loop through a bunch of documents I have to put

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.