Manick
Manick

Reputation: 857

barcode scanning in android emulator

I'm trying to do barcode scanning using Android emulator. Could anyone please tell me what steps to follow to do a simple barcode scanning on the emulator?

Thank for any help,

Upvotes: 28

Views: 57867

Answers (6)

Alessandro Vendramini
Alessandro Vendramini

Reputation: 31

It is possible if you have a camera on your pc/laptop.

In Android Studio:

  • Open Device Manager;
  • Select the emulator device and click on Edit icon button;
  • On Camera section you can find Front and Back;
  • Select Webcam (In my case on mackbook I have Webcam0) in both cases ;
  • Save settings and close emulator;
  • On Device Manager select the emulator device -> 3 dots -> Cold Boot Now;
  • Now when you open camera activity/fragment/compose_view on your emulator, android studio may requires the camera permission on your mac/windows.

Upvotes: 2

Badr Bellaj
Badr Bellaj

Reputation: 12871

Yes it is possible. you can use the camera of your laptop as the AVD's front or back camera

enter image description here

Upvotes: 11

Dom Hoàn
Dom Hoàn

Reputation: 320

In Android Studio,go to AVD Manager

  • Choose a device then Click "Edit this device" ->

  • Click Show Advanced Settings

  • At camera, select Front: Emulate, Back: VirtualScene.

  • Then Run App, Click ... - (icon More) at toolbar of device

  • Click icon camera

  • Click folder and choose image QR, then you can scale it

  • Close panel, an continue run app.

  • When you go to Scan QR Screen, please use ALT + QWEASD to move and controlThis location

    Then image will be scan

Upvotes: 28

Rafael Figueiredo
Rafael Figueiredo

Reputation: 359

Yes, you can set the image of wall and table from virtual scene on emulator config.config android emulator

Upvotes: 35

Julien
Julien

Reputation: 807

You can enable the cam on android emulator, and so use a barcode scanner on it.

To do so, you have to set the emulator property "configures camera facing back" (or front) to "yes" or "webcam0".

source : http://viralpatel.net/blogs/enable-camera-in-android-emulator/

Upvotes: 13

Hulk
Hulk

Reputation: 2561

You can't use barcode scanner on emulator because for scanning you need a camera..so if possible then use mobile device for it..

Upvotes: 4

Related Questions