QR code to launch your own application

2 questions about using a QR code on an Android device: 1. Can I run my own Android application from a QR code? Maybe with some customized URI scheme? 2. Another option that may be useful to me is to have a QR code scanner inside my own application. Will it be possible for me to somehow include another application that scans QR codes inside my application? Or should I do the scan myself?

thanks

+2
source share
2 answers

To scan barcodes in Android by Intent, see https://github.com/zxing/zxing/wiki/Scanning-Via-Intent

To run the application from the QR code, yes, you need to register the application to process a specific custom URL scheme. Here's how the same application can respond to clicks on the Internet: https://github.com/zxing/zxing/wiki/Scanning-From-Web-Pages

See how it logs in to handle URLs here: https://github.com/zxing/zxing/blob/master/android/AndroidManifest.xml

+7
source

1. To use the customized schema, you can check this message

Launch a custom Android application from an Android browser

Then you could have a QR code of this scheme, as in the market: //
2. You can use the barcode scanner application and use the below code to run, or you can even integrate the zxing library for scanning yourself.

Intent intent = new Intent("com.google.zxing.client.android.SCAN"); intent.setPackage("com.google.zxing.client.android"); intent.putExtra("SCAN_MODE", "ONE_D_MODE,QR_CODE_MODE,PRODUCT_MODE,DATA_MATRIX_MODE"); startActivityForResult(intent, 0); 
+1
source

Source: https://habr.com/ru/post/905970/


All Articles