Gas Management System Android application
the password for all Activity is the same 123 the user name is mgr , age , rep , aqe
implementation 'com.google.zxing:core:3.4.1' implementation 'com.journeyapps:zxing-android-embedded:4.2.0'
IntentIntegrator integrator = new IntentIntegrator(activity);
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE);
integrator.setPrompt("scan");
integrator.setBeepEnabled(false);
integrator.initiateScan();
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode , resultCode , data);
if(result !=null)
{
if(result.getContents() ==null)
{
Toast.makeText(getBaseContext() , "you canceled the scan" , Toast.LENGTH_SHORT).show();
}
else
{
Toast.makeText(getBaseContext() , result.getContents() ,Toast.LENGTH_SHORT).show();
}
}
else {
super.onActivityResult(requestCode, resultCode, data);
}
}