12

I would like to install the android-vision portion of google play services on devices that are not allowed to have a google account signed in. Traditionally, the android-vision library is downloaded through the play store as an update to google play services.

According to this, the package name should be com.google.android.gms.vision.barcode. I used adb to list all packages installed on my rooted nexus device that has the barcode scanning library downloaded and the package was not in the list. I was hoping to pull the package itself and then distribute it.

Thank you for your time and effort.

Foxx
  • 133
  • 1
  • 4
  • Did you ever get a solution for this? Is it possible to use Google Mobile Vision without a Play Store account? – Jan Misker Jul 06 '17 at 09:23
  • have you found any solution, i also have the same question. – Amir Dora. Jun 21 '18 at 11:52
  • Check in your gradle cache to see if it might be in there. at \Users\\.gradle\caches\modules-2\files-1\ there are all your aars that were cached during syncing/building. They're organized by name, such as com.google.android.gms\play-services-\\ – Timothy Winters Jun 28 '18 at 00:48
  • Did you find a solution for this? I am writing apps that need to run in a secure environment, the devices must NEVER have EVER connected to the internet after unboxing and being secured by the hardware people. I'm looking into using Camera2 to get a feed directly from the camera and then using ZBar for detection and decode, but it's proving to be tricky. If I could just embed the vision library it would be problem solved. – LordWabbit Nov 24 '21 at 19:44
  • Unfortunately we ended up abandoning android-vision as a viable option. – Foxx Nov 25 '21 at 21:42

3 Answers3

3

For any google service,you should register your add app at console.

If you don't want to add your app then you can use any third party API for barcode.

https://github.com/zxing/zxing

ViramP
  • 1,659
  • 11
  • 11
  • Can you explain how registering my app at the console would help me solve my problem? – Foxx Aug 23 '16 at 14:15
  • Here You can add google service barcode like below URL: https://developers.google.com/vision/barcodes-overview Sample code: https://github.com/googlesamples/android-vision/tree/master/visionSamples/barcode-reader For Google console : You need to enable : Google Cloud Vision API but before that you need add your application: https://console.developers.google.com/apis/dashboard – ViramP Aug 23 '16 at 14:24
  • 1
    Okay, this is not answering my question. The Cloud Vision API is not the same as the android vision API. I also already have a working application using the API. My question is on how to install the barcode scanning library without having the device signed into a google account. – Foxx Aug 23 '16 at 14:44
  • Ok I have checked for barcode-reader api not need to add application at google app console – ViramP Aug 24 '16 at 07:09
2

You can use Third Part Library implementation com.journeyapps:zxing-android-embedded:3.5.0

Using this library you can easily integrate QR-Code and BAR Code Reader as well without signing in with a google account.

My code here for Bar-Code Reader:

    package com.example.elanwrap.qr_code_elan;

    import android.content.Intent;
    import android.net.Uri;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.Toast;
    import com.google.zxing.integration.android.IntentIntegrator;
    import com.google.zxing.integration.android.IntentResult;

    import static android.widget.Toast.LENGTH_LONG;

    public class MainActivity extends AppCompatActivity {

        Button button;
        //CREATING OBJECT
        private IntentIntegrator qrCode;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            button = (Button) findViewById(R.id.button);

            qrCode = new IntentIntegrator(this);

            button.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                   //  start the Scan here
                    qrCode.initiateScan();
                }
            });
        }

        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
            IntentResult intentResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
            super.onActivityResult(requestCode, resultCode, data);
            if (intentResult != null) {
             //passing result to another Activity.
            //    Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(intentResult.getContents() + ""));
                Intent browserIntent = new Intent(this, Result_activity.class );
                browserIntent.putExtra("rah",(intentResult.getContents()+""));
                startActivity(browserIntent);



            } else {
                Toast.makeText(getApplicationContext(), " Empty Result ", Toast.LENGTH_SHORT).show();
            }
        }
    }

and:

package com.example.elanwrap.qr_code_elan;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;
import android.widget.Toast;

public class Result_activity extends Activity {
    TextView textView;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.result_activity);
        textView=(TextView)findViewById(R.id.details);
        Intent intent = getIntent();
        String str = intent.getStringExtra("rah");
        textView.setText(str);
        Toast.makeText(this, str, Toast.LENGTH_SHORT).show();
    }
}
Roel Strolenberg
  • 2,922
  • 1
  • 15
  • 29
Rahul Kushwaha
  • 5,473
  • 3
  • 26
  • 30
  • Yeah, but this still launches another application that leaves the current activity and interrupts the workflow. I still haven't found a library that I am content with. I just want something that takes image formats as input and reports a result back so that it can fit into other people's camera feeds and custom applications. Google's vision API I have issues with as well since it requires initial downloads when distributed with the SDK. – Jay Snayder Aug 06 '19 at 12:08
1

Step 1 : Try including this lib in app based gradle file

Implementation com.google.android.gms:play-services-vision:11.0.2

Implementation info.androidhive:barcode-reader:1.1.2

Step 2 : Create your layout for scanning by taking reference from the link

Lovepreet Singh
  • 4,792
  • 1
  • 18
  • 36
  • This does not help, it just wraps the vision barcode library in an easy to use fragment, it still requires an active internet connection and a play store account. – LordWabbit Nov 24 '21 at 19:38