BarCode Scanner

java
android

#1

Hey guys I need help figuring out how to tweak my code so that it reads Barcodes comprised of the following formats “CODABAR,CODE_128,CODE_39,CODE_93,DATA_MATRIX, EAN_13,EAN_8…etc.” I am working in Android Studio by the way, here is my current code

public class MainActivity extends AppCompatActivity {

String scannedData;


Button scanBtn;
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
   final Activity activity =this;
    scanBtn = (Button)findViewById(R.id.scan_btn);

   scanBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            IntentIntegrator integrator = new IntentIntegrator(activity);
            integrator = integrator.setDesiredBarcodeFormats(IntentIntegrator.ONE_D_CODE_TYPES);
            integrator.setResultDisplayDuration(0);
            integrator.setPrompt("Scan");
            integrator.setBeepEnabled(false);
            integrator.setCameraId(0);
            integrator.setBarcodeImageEnabled(false);
            integrator.initiateScan();
        }
    });