How to scan a QR code on Honor and Huawei phones

3 ways to scan a QR code on an Honor and Huawei phone

Let's look at the proposed options using the example of Huawei P Smart 2018 with Android 8.0 running the EMUI 8 user interface. Step-by-step instructions are provided for each of them. All these options also work on Honor series devices. It’s worth remembering that to scan a QR code, you need a Wi-Fi or mobile Internet connection.

On the locked screen of a smartphone

In the proprietary EMUI 8 shell, there is a very useful quick tools menu available on the device’s locked screen. To activate this menu, just swipe up on the unlock screen, after which it will appear at the bottom of the screen. Here you can launch a calculator, a flashlight, a stopwatch and the QR scanner - it is located in the lower right corner of the panel.

The smartphone goes to the camera application and automatically turns on the scanning function. All that is now required is to keep the object being scanned within the marked square. Upon completion of the operation, you will be provided with a scanned code link, however, in order to follow it, you will need to unlock your device - this is a security measure.

Scanner on EMUI 8 In the same way, you can enable the QR scanner on Honor 10 and Huawei P20 lite, because these devices are also running EMUI 8 (at the time of writing).

Via "Quick search for applications"

In order to enable the quick search bar for applications, you need to be on the desktop of the device and swipe down. A search bar will appear at the top , on the left side of which you will see a QR scanner icon.

By clicking on it, the smartphone will go into scanning mode, and you will see an area in the form of a square. Keep the QR code inside this area, and as a result, the smartphone will show the received link in a new window.

Using the camera

  1. Turn on the camera and take a clear photo of the QR code.
  2. Then, click on the icon of the created photo, which is located in the lower left part of the screen. A toolbar will appear, we need the “More” .
  3. After clicking it, another menu will appear with many functions, among which we need the lowest item - “Scan QR code” .
  4. The system will automatically recognize the code and then display the scanning result in a new window. Now you can go to the desired site.

QR and barcode scanning with built-in Google Assistant support

Some versions of Emotion UI shells on Huawei and Honor smartphones do not contain the functions described above. In this case, you shouldn’t be upset, because the built-in support for Google Assistant will come to the rescue.

  1. Unlock your smartphone. In the navigation buttons, press and hold the circle for a period of time until you go to Google Assistant. Then click on the box icon at the bottom left. An additional menu will open. Select the camera icon on the left side of this menu.
  2. Now scan the QR or barcode you need. To select, click on the location of the code on the screen of your mobile device. If you have any questions about scanning QR and barcodes on Huawei and Honor smartphones, then write to us in the comments.

QR codes are gaining more and more popularity every day, spreading mainly in places where placing traditional links would be a great inconvenience. They are often found in museums, on historic buildings and on business cards . However, many users have stopped paying attention to them, because they do not know what they are for and how to use them. You will find out what it is and how to scan a QR code on Honor and Huawei later in the article.

Third-party applications for reading QR codes on Huawei

There are many ways to scan a QR code. And although Huawei smartphones have a built-in QR scanner, it only has the ability to read and display a link, without any conveniences that applications from Google Play can offer us. Now we will look at the most popular of them, including for Honor.

QR and barcode scanner

QR Code

QR and barcode scanner

Developer: Gamma Play

Price: Free

QR and barcode scanner Gamma Play is an excellent program that has a set of useful functions, such as a history of scanned codes, an inverted color mode and automatic navigation to links.

To read a QR code in this application, you need to click on the button in the form of 3 stripes in the upper left corner of the screen. A menu will appear on the left, the topmost item of which is called “Scanning”.

After pressing the button, the application puts the smartphone into scanning mode. We hold the object in the intended area and wait for the scanning to complete.

Afterwards, you will be provided with a link through which you can immediately go to the browser and view the desired site.

The application stands out from the standard one by having a history of scanning results. To turn it on, you need to press the button with 3 stripes. A menu appears on the left, the second item of which, if you count from the top, is history. Click on the “History” .

A list of previously received links appears. By clicking on each of them, we are given detailed information about each scanned object. Here you can find the QR code you read earlier.

The advantage over the built-in utility is also noticeable in the application settings. One of the useful features is the ability to enable automatic transition to the site after scanning. As well as inverting colors, when black turns into white and vice versa.

This can be useful when scanning on a white surface. Some devices may not operate properly under these conditions.

Third party apps for Honor

In addition to the built-in tools, you can use special programs designed to read codes.

QR Scanner

This application is definitely worth installing even on a smartphone equipped with built-in scanning tools. The developer of the program is Kaspersky Lab, the creator of popular antivirus software.

Using QR Scanner, the smartphone owner gets the following features:

  • quick detection of links to malicious or fraudulent resources;
  • automatic security check of all linked data - texts, pictures, videos, links.

The application is supplemented with the following useful features:

  1. Quickly recognize contacts and transfer them to the phone book. Actions are performed with the user's permission.
  2. Saving scanned data in the application memory, where the information can be viewed at any time if necessary.
  3. Automatic activation of the Wi-Fi module. If the reading requires an internet connection, the app quickly establishes a wireless connection.

Lightning QR scanner

Another application, in addition to scanning, has a number of additional options:

  1. Increased speed of processing information and making it look familiar for use.
  2. Perform the actions necessary for reading with the permission of the user. The program cannot independently turn on the Wi-Fi module or open other applications.
  3. Use the links received during scanning for their intended purpose. It is possible to send information to an email address.
  4. Possibility to turn on a virtual flashlight used to highlight the image with the code. Helps make the scanning process easier.

Download and install the program using the Google Play service. The simple interface makes it convenient to use.

Answers to popular questions

Why is there no app for scanning QR codes on Honor 7C?

Honor 7C is a budget smartphone priced under $200. The manufacturer, in order to reduce the cost of producing the device, resorts to such software cuts. But don't worry, you can still install third-party software to read codes.

Is it possible to somehow expand the functionality of the built-in scanner?

There are no standard methods, but if Root rights are installed on the phone, this can be completely corrected with the right actions.
Huawei smartphones with the Android 8.0 Oreo operating system have an excellent EMUI shell, which boasts a large selection of QR code scanning methods. However, third-party applications are still ahead of it in terms of the number of conveniences and functions. And the choice of what is more convenient for you is yours. We hope that the article helped you understand the issue and you understand how to scan a QR on Huawei (Honor) smartphones.

QR code - what it represents and why it is needed

A QR code is a small image containing encrypted information for the user.

Most often it is an analogue of unobtrusive advertising that can be read, saved in your phone and always kept at hand. See those little abstract black and white squares on posters, packaging, websites or ads? This is exactly what QR is, which we will learn how to use below.

The “quick response” type code can be read by anyone. The information it contains is also different. These are links, slogans, addresses and telephone numbers, company names, geographic coordinates, etc. This type of encryption is supported by its compactness and “neutrality”, ease of use due to the significant spread of portable equipment

Scan QR codes using HUAWEI Scan Kit

Post Views: 3,627

To make it easier to create applications on Android , many different services have been developed to automate various processes or simplify their execution. Typically, most of these services are created by Google and are part of Google Mobile Services ( GMS ), which provides a wide range of tools for work. And although they work on most Android , there are devices that, for one reason or another, do not support these services, in which case you have to look for alternatives.

For example, one of such devices are Huawei . Due to the fact that new Huawei no longer support GMS , the company has relaunched and updated its own equivalent called Huawei Mobile Services ( HMS ). Its task is to create a convenient ecosystem that allows you to create applications quickly and efficiently, and provide both the services necessary for the application to work (cards, cloud storage, payments, authentication) and additional ones that expand the capabilities of the application. Especially for developers, HMS has a component called HMS Core , which provides all the necessary APIs and SDKs for working with services. In addition, as Huawei , HMS Core is written in such a way that it is easy for developers to rewrite their applications running on GMS for HMS .

Let's look at the work of HMS Core using the example of a service for generating and scanning QR codes . One of our applications, “ Wi-Fi Network Password Manager ,” uses Huawei saved network data, which can then be shared with other people. However, the application does not have the ability to scan this code and read its contents. Let's add this feature.

HMS Core itself is not monolithic; it is divided into a number of separate components, each of which works with a specific service. In our case, to add a QR code we will need a tool called Scan Kit .

Scan Kit allows you to scan and read all major 1D and 2D barcodes (which also includes QR codes ), as well as generate your own. It automatically detects, enlarges and recognizes barcodes, allowing it to read even the smallest barcodes without problems. In addition, the Scan Kit can work even in low light conditions or if the barcode is dirty or reflective, allowing you to scan efficiently in any conditions. The service can work on both Android and iOS, but in this case we are only interested in Android .

Scan Kit can recognize 13 main barcode formats:

  • 1D barcodes: EAN-8, EAN-13, UPC-A, UPC-E, Codabar, Code 39, Code 93, Code 128 and ITF;
  • 2D barcodes: QR code, Data Matrix, PDF417 and Aztec.

Another important feature of Scan Kit is that the library can work in different modes:

  • Default View - using the default view and activity;
  • Customized View - using your own view;
  • Bitmap - allows you to better customize the scanning process;
  • MultiProcessor - uses ML Kit to recognize multiple objects simultaneously.

As you can understand, Default View is the simplest option when you don’t need to create your own interface for scanning and just get the result, which eliminates the need to write unnecessary code. Customized View differs from the previous one only in that the interface and design are created by the developer. Bitmap, in turn, determines whether the barcode being scanned is far away, and if so, returns the amount by which the image should be enlarged. Finally, MultiProcessor uses machine learning to make barcode scanning even more efficient.

For our application, we will use Default View , since there is no need to create a separate interface, and the automatic operation of the scanner will be quite sufficient for the result.

Let's start embedding this library into the application.

Important! In order to work with HMS, you must first register a developer account in HUAWEI Developer, then go through verification and create an application project in the Huawei console.

Before adding the library, we will need to download the configuration file and add it to the project. To do this, let's go to the AppGallery Connect and open the settings of the application for which we are embedding the Scan Kit. The configuration file you need is called agconnect-services.json .

Then we will put this file in the app of the application project.

Now let's add the Huawei repository and the AppGallery Connect plugin. To do this, open build.gradle and add the following lines to it:

buildscript { repositories { mavenLocal() jcenter() google()
maven {url 'https://developer.huawei.com/repo/'} } dependencies { … classpath 'com.huawei.agconnect:agcp:1.3.1.300' } } apply plugin: 'nebula.lint' gradleLint.rules = ['all-dependency'] allprojects { repositories { google() jcenter() mavenCentral() maven { url "https://jitpack.io" } maven { url " https://maven.google.com" } maven {url 'https://developer.huawei.com/repo/'} } }
After that, let's go to the build.gradle of the application module and add a dependency with the Scan Kit library and AppGallery Connect plugin.

dependencies { …
implementation 'com.huawei.hms:scanplus:1.2.1.300' } apply plugin: 'project-report' apply plugin: 'com.huawei.agconnect'
It's worth noting that Scan Kit provides two SDK options: Scan Kit SDK and Scan Kit SDK Plus . Both options are identical in functionality, but differ in the quality of recognition on non-Huawei devices. The Scan Kit SDK uses generic recognition tools on such devices, which perform slightly worse than those used on Huawei devices. Scan Kit SDK Plus, in turn, uses improved recognition, which allows you to work equally effectively with barcodes both on Huawei devices and on any other. Therefore, if adding ~2 MB to the APK size is not critical, it is best to use the Plus .

Note : HMS Core adds all supported languages ​​to the app, which may add extra size to the APK. To limit ourselves to only the list of those languages ​​that are needed, open the build.gradle of the application module and add the necessary languages ​​to defaultConfig:

defaultConfig { ...
resConfigs "en", "zh-rCN", "zh-rTW", "de", "el", "es-rES", "es-rUS", "fa", "fi", "fr "", "hi", "it", "ja", "ko", "pt-rBR", "pt-rPT", "ru" }

To ensure that the library works correctly in the release version of the application, we add the following exceptions to proguard-rules.txt :

-ignorewarnings -keepattributes *Annotation* -keepattributes Exceptions -keepattributes InnerClasses -keepattributes Signature -keepattributes SourceFile,LineNumberTable -keep class com.hianalytics.android.**{*;} -keep class com.huawei.updatesdk.**{*; } -keep class com.huawei.hms.**{*;}

Now that the library has been added and prepared, we can proceed directly to the code. Since scanning will be done using a camera, the CAMERA , which will then be requested from the user before scanning begins. To do this, add the following line to AndroidManifest.xml :

… …

When a user wants to scan a QR code, they need to check if the app has permission to use the camera, and if not, request it. If there is permission, we call the takeBarcodePicture() method, which will initialize the scanning.

if (mainView != NULL) { if (Tools.hasSelfPermission(mainView.getActivity(), Manifest.permission.CAMERA)) { takeBarcodePicture(); } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { mainView.getActivity() .requestPermissions( new String[] { Manifest.permission.CAMERA }, REQUEST_PERMISSION_TAKE_PHOTO); } } }

The request result comes to the onRequestPermissionResult() , where we check whether the user has agreed to grant permissions to the application or not.

if (Tools.verifyAllPermissions(grantResults)) { takeBarcodePicture(); } else { mainView.onShowToast(R.string.permission_denied); }

When the camera has permission, in the takeBarcodePicture() we define the parameters for scanning and call the startScan() with the specified parameters.

private void takeBarcodePicture() { if (mainView == NULL) return; HmsScanAnalyzerOptions options = new HmsScanAnalyzerOptions.Creator().setHmsScanTypes(HmsScan.QRCODE_SCAN_TYPE, HmsScan.DATAMATRIX_SCAN_TYPE).create(); ScanUtil.startScan(mainView.getActivity(), REQUEST_CAMERA, options); }

As mentioned above, we used the default scanning option, so we need to add the library activity to our AndroidManifest.xml:

The result of the scan is returned to the onActivityResult() and has the code that was assigned in startScan() , i.e. REQUEST_CAMERA .

case REQUEST_CAMERA: { if (resultCode == Activity.RESULT_OK) { HmsScan obj = data.getParcelableExtra(ScanUtil.RESULT); if (obj != NULL) { if (BuildConfig.DEBUG) Log.d("HmsScan", obj.getOriginalValue()); if (obj.getScanTypeForm() == HmsScan.WIFI_CONNECT_INFO_FORM) { HmsScan.WiFiConnectionInfo wifiConnectionInfo = obj.getWiFiConnectionInfo(); String password = wifiConnectionInfo.getPassword(); String ssidNumber = wifiConnectionInfo.getSsidNumber(); int cipherMode = wifiConnectionInfo.getCipherMode(); showAddButtonDialog(ssidNumber, password, cipherMode); } } } break; }

If the library activity returned the result RESULT_OK , then we get an HmsScan containing the result of scanning the QR code. Depending on what data was encrypted into the QR code, different methods should be called on the HmsScan object to obtain this data. Since a QR code can contain a variety of information, you should check what data it contains before starting work. To make sure that the scanned QR code contains data about the Wi-Fi network, call the getScanTypeForm() . Since we generated a QR code with Wi-Fi network data, we need to find out the network SSID, password and encryption type. So we should call getSsidNumber() , getPassword() and getCipherMode() respectively.

We then pass these parameters to showAddButtonDialog() where we show them to the user.

Thus, using the capabilities of HMS Core, you can easily work with QR codes , and there is no connection to specific Huawei ; scanning works equally well on other devices. Scan Kit provides rich tools for both easy implementation and fine-tuning, which makes it a good replacement for similar Google .

Rating
( 2 ratings, average 4.5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]