Scanning codes with android phone

How to Scan a QR Code on an iPhone or Android

These days, you can find QR codes on everything from candy wrappers to billboards. Scanning these modern-day barcodes with your smartphone lets you quickly open a web page, download an app, send a text message, and much more. Many restaurants and bars are even replacing their menus with QR codes, while some stores allow you to pay with a QR code now, so you don’t have to touch anything. Here’s how to scan a QR code with your iPhone or Android phone and what to do when you can’t scan them.

How to Scan a QR Code on an iPhone

To scan a QR code on your iPhone, all you have to do is open the Camera app and point your phone at the QR code. Make sure the QR code is inside the box on your screen, and then tap the pop-up banner or the yellow QR code icon in the bottom-right corner.

  1. Open the Camera app on your iPhone. You can quickly open the camera app by swiping left from the lock screen. Or you can swipe down from the middle of your home screen and type “Camera” into the search bar at the top of your screen.
  2. Then point your iPhone at the QR code to scan it. You don’t have to fill the entire screen, but make sure that you can see all four corners of the QR code in the app. Once you correctly scan the QR code, a pop-up banner will appear above it, and you will also see a yellow QR code icon appear in the bottom right corner.
  3. Finally, tap the pop-up banner or the QR icon in the bottom-right corner of the app. This will immediately send you to the website, open the app, or perform another action, so make sure you know what the banner does before tapping on it.

If you don’t see the banner or QR icon, make sure that you have the Scan QR Codes feature enabled. You can do this by going to Settings > Camera and tapping the slider next to Scan QR Codes. You will know it is turned on when it is green.

If you still don’t see the pop-up banner or QR code icon, take a picture of the QR code and open it in the Photos app. Then tap the Live Text icon that looks like three lines in a box in the bottom-right corner. Finally, tap the QR code, and then the pop-up banner should appear.

If you want to know more about how to take a screenshot on an iPhone, check out our step-by-step guide here.

How to Scan a QR code on an Android Phone

If you’re running Android 8 or later, you can scan a QR code by opening the camera app, pointing your phone at the QR code, and tapping the pop-up banner. If you don’t see the pop-up banner, you can use the Google Lens app to scan the QR code instead.

Читайте также:  List all fragments android

  1. Open the Camera app on your Android phone. You can open the camera app by swiping up from the bottom of your screen. Or you can tap the search bar on your home screen and enter “Camera.”
  2. Then point your Android phone at the QR code to scan it. Make sure that all four corners of the QR code are visible in the viewfinder. If you are running Android 8 or later, you should see a pop-up banner appear.
  3. Finally, tap the pop-up banner. This will immediately send you to the website, open the app, or perform another action, so make sure you know what the banner does before tapping on it.

If you don’t see the banner appear, you can use Google Lens instead. You might see the Lens icon (which looks like a circle inside a broken box) somewhere on your screen. Or you might have to tap Modes (or More) in the bottom-right corner of the app and select Lens. Then place the QR code in the white lines and tap the magnifying glass icon to scan it.

You can also open Lens on some phones by tapping and holding the QR code on your screen until you see a multi-colored spinning wheel. Then tap the pop-up banner when it appears above the QR code.

If Google Lens isn’t working in your camera app, you might have to enable it in your settings. You can check your camera settings in the app or in the general settings on your Android. Then enable the Google Lens suggestions option.

You can also download the Google Lens app from the Google Play Store. Once you open the app, move the QR code to the center of the viewfinder and tap the magnifying glass icon at the bottom of your screen to scan it.

If you are running Android 7 or earlier, your phone might not be compatible with the app, but you might already have the Google Lens feature on your Android device. To find out, press the Home button at the bottom of your device (or the line at the bottom of your screen) until the Google Assistant pops up. Then tap the Google Lens icon or select the microphone icons and say, “open Google Lens.”

If all else fails, you can take a picture or screenshot of the QR code, open the Google Photos app, and tap the Google Lens icon below that picture.

If you want to know how to take a screenshot on your Android phone, check out our step-by-step guide here.

Источник

Распознавание Barcode Android

В данной статье мы будем использовать ZXing (Zebra Crossing), чтобы расшифровать штрихкод в нашем Android приложении.

Используя ZXing, нам не нужно думать о том, что у пользователя нет сканера barcode, так как классы, предоставляемые библиотекой позаботятся об этом. Интегрируя ZXing в наше приложение мы можем предоставить пользователю более простую возможность сканировать шрихкоды, также это позволит нам сфокусироваться на разработке основной части приложения.

Создание нового проекта

Шаг 1

В Eclipse создайте новый Android проект. Введите имя приложения, проекта и название пакета.

Шаг 2

Откройте основной шаблон. Eclipse должен был создать стандартный шаблон. Внутри него замените существующий контент на кнопку

После кнопки добавим два текстовых поля, которые будут отображать результаты отсканированной информации.

Добавьте к кнопке текст. Откройте файл res/values/strings

Чтобы просканировать пользователь должен будет нажать на кнопку. Когда приложение получает результат распознавания, оно отобразит его в текстовых полях.

Интегрируем ZXing

Шаг 1

ZXing — библиотека с открытым исходным кодом, предоставляющая возможность распознавания штрихкодов на Android. Некоторые пользователи уже имеют установленное приложение ZXing, поэтому достаточно передать ему код и дождаться результатов. В данном приложении мы рассмотрим способ, вызывающий соответствующую функцию другого приложения. Если данное приложение отсутствует у пользователя, то будет выведено предложение скачать его.

Читайте также:  Аналог флеш плеера для андроид

В Eclipse добавим новый пакет в Ваш проект. Для этого кликнем правой кнопкой мыши по папке src и выберем «New»->«Package», а затем введем com.google.zxing.integration.android в качестве имени пакета.

Шаг 2

Eclipse предлагает несколько способов импортирования существующего кода в проект. В данной статье самым простым методом будет создание двух классов, содержащий код из ZXing. Кликните правой кнопкой мыши по Вашему проекту, выберете «New»->«Class» и введите «IntentIntegrator» в качестве названия класса. Остальные параметры Вы можете не изменять. Как только Вы создали класс, проделайте тоже самое, но назовите класс «IntentResult».

Скопируйте код из обоих классов библиотеки, а затем вставьте его в созданные классы.

Теперь Вы можете подключить файлы в основной класс

Вернемся на минутку и также подключим следующие файлы. Обратите внимание, что Eclipse мог уже их подключить за Вас

Изучите содержание двух классов. Изучив их Вы обнаружите, что они не считывают код. Эти два класса являются просто интерфейсами, предоставляющими доступ к функционалу сканирования.

Сканируем

Шаг 1

Давайте реализуем сканирование, когда пользователь нажимает на нашу кнопку. В главном файле приложения существует метод onCreate, который должен выглядеть примерно так

Перед данной функцией создайте следующие переменные, которые будут хранить нашу кнопку и два текстовых поля, созданных в шаблоне

После существующего кода в onCreate добавьте строки, которые будут инициализировать переменные

Теперь, добавим обработчик нажатия

Расширим класс, чтобы объявить интерфейс OnClickListener

Шаг 2

Теперь, мы можем реагировать на нажатие кнопки началом процесса сканирования. Добавим метод onClick

Проверяем, была ли нажата именно кнопка сканирования

Внутри блока с условием создадим экземпляр класса IntentIntegrator, который мы импортировали

Сейчас, давайте вызовем процедуру, которая начнет сканирование

В данный момент должно начаться распознавание, но только, если у пользователя установлено необходимое приложение. Если его нет, то будет предложено начать загрузку. Результат сканирования будет возвращен приложению.

Обработка результатов сканирования

Шаг 1

Сканер будет запущен, когда нажата кнопка. Затем будет возвращен результат сканирования в метод onActivityResult. Добавим его в наш код

Внутри функции постараемся обработать результат

Шаг 2

Как и любые другие данные, полученные от другого приложения, было бы не плохо проверить, что результат не пуст. Продолжим мы только, если у нас есть правильный результат

Если мы не получили результат сканирования (например, пользователь отменил сканирование), то мы просто выведем сообщение

Вернемся в блок с условием, давайте разберемся с тем, что нам вернула библиотека. Объект Intent Result имеет метод, обеспечивающий получение результата сканирования. Получим результат сканирования, как строку

Также, получим вид barcode

Шаг 3

Теперь, наше приложение имеет всю необходимую для отображения информацию. В нашей статье мы просто отобразим ее пользователю.

Запустите наше приложение на реальном устройстве вместо эмулятора, чтобы увидеть, как работает функционал распознавания штрихкодов. Попробуйте просканировать штрихкод с какой-нибудь книги или любого другого товара.

Результаты сканирования

Источник

How to Scan QR Codes on Your Phone

iPhone and Android users, we’re talking to you

What to Know

  • iPhone (iOS 11 or later): Launch the Camera app, frame the QR code, and tap the notification.
  • Android devices: You’ll need to download a third-party app, such as QR Code Reader.
  • Scan QR codes only from companies you trust.

This article explains how to scan a QR (Quick Response) code on an iPhone or Android device. Some smartphones may require that you download a mobile app, and we recommend a few options below.

How to Scan a QR Code With an iPhone Running iOS 11 or Later

An iPhone with iOS 11 (or later) comes with a built-in QR reader in its camera. To scan a QR code with an iPhone camera, follow these steps:

Читайте также:  Русификатор для андертейл андроид

Launch the Camera app.

Frame the QR code.

Look for the notification banner at the top of the screen.

Tap the notification to trigger the code’s action.

Smartphones with iOS 10 or earlier can scan many types of QR codes using the Wallet app, which stores event tickets, boarding passes, coupons, and loyalty cards. The Wallet app can’t read every QR code, though; only items it recognizes as passes, like the examples above. For a one-stop QR reader, you’ll need a third-party app.

Best iPhone QR Code Reader App

The free Quick Scan – QR Code Reader is a full-featured app that can read QR codes out in the world and from images in your photo roll.

It can also add contacts to your address book, open links, and map locations, and add events to your calendar app. You can save codes for future reference, and the app has unlimited storage. All you have to do is open the app and point to the QR code you’d like to scan. If it leads to a URL, you’ll get a notification that you can tap.

How to Scan a QR Code With an Android Phone

Android doesn’t have a built-in QR code reader, so you’ll need to download a third-party app and follow its instructions. To scan a QR code, you need a smartphone with a camera and, in most cases, that mobile app. Some Android phones might also have this functionality built-in.

» data-caption=»» data-expand=»300″ data-tracking-container=»true»/>

Screenshot on android phone

In general, the process is:

Launch your camera.

Point it at the QR code.

Press and hold the home button.

Tap to trigger the code’s action.

Best QR Scanner for Android

The QR Code Reader (free; by TWMobile) can scan QR codes, including Wi-Fi QR codes, which enable users to connect to a Wi-Fi hotspot without inputting a password.

When you want to scan a QR code, launch the app and point your smartphone at it; you’ll then either see the code’s information or get a prompt to open a URL.

Ways to Use QR Codes

When you scan a QR code, it might open a link to a website or social media account, display a YouTube video, show a coupon, or contact details.

Advertising is probably the most common use of QR codes. Brands can add a QR code to a billboard or magazine, for example, that sends users to its website or a coupon or landing page. For the user, this takes away the hassle of typing in a long URL, or jotting it down on paper. The advertiser benefits from real-time results in which the user immediately visits their website rather than waiting until they get home, or worse, forgetting about it altogether.

Another use is through a virtual store, in which there’s a large touch screen in a public place, such as a subway station or plaza. Shoppers can scan items with their smartphones and get the items delivered at a chosen time and location. Each piece has a unique QR code and works with a mobile app that stores payment and shipping information.

QR codes are often used to transfer cryptocurrency, including Bitcoin. Some cemeteries around the world have started adding QR codes to tombstones to make it easier for visitors to locate the gravesite.

It’s a good practice to only scan QR codes from companies that you trust because of security concerns. A hacker could link a QR code to a malicious website that looks legit but instead phishes your personal information when you try to log in. Also be sure to check the URL before inputting your credentials, something you should already be doing anyway.

Источник

Оцените статью