Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Front Camera on Android #3

Closed
Daveoc64 opened this issue Dec 8, 2012 · 8 comments
Closed

Use Front Camera on Android #3

Daveoc64 opened this issue Dec 8, 2012 · 8 comments
Assignees
Milestone

Comments

@Daveoc64
Copy link

Daveoc64 commented Dec 8, 2012

While I realise that it would be a bit awkward to use, it would be nice if a device that only has a front camera (e.g Nexus 7) could still scan barcodes.

Perhaps an option could be added to choose which camera to use if more than one is available.

@ghost ghost assigned Redth Dec 10, 2012
@Redth
Copy link
Owner

Redth commented Dec 10, 2012

Good idea, I'll look at adding this into the api!

@AMersch
Copy link
Contributor

AMersch commented Jan 24, 2013

I will take a look.

@Redth
Copy link
Owner

Redth commented Jan 25, 2013

I'm doing this already in another app (so I can use my Nexus 7).. Just a matter of bringing over that code...

@Redth Redth closed this as completed in a736913 Jan 25, 2013
@jstawski
Copy link

jstawski commented Apr 9, 2013

Hello, I'm testing the library with my Nexus 7 and all I see is the overlay without the camera feed. the same result is seen with both the sample app and my own app. I'm running Android 4.2.2.

@Redth Redth reopened this Apr 9, 2013
@Redth
Copy link
Owner

Redth commented Apr 12, 2013

@jstawski the code already exists for this, but it's in an #if _ANDROID_9 block, which means this feature is only available if you target API level 9 or higher (that's Gingerbread, android 2.3). By default the Sample app is set to target 2.2 Froyo (API Level 8) so the code is never executed for multiple cameras (or front cameras). Try going into your sample project properties and in the 'General' section, setting the Target Framework to Android 2.3 (Gingerbread).

It should then use the Nexus 7 camera. I have a Nexus 7 here and it is working fine :)

@Redth Redth closed this as completed Apr 12, 2013
@jstawski
Copy link

I will do that with the sample project and give it a shot, but my application targets 4.0+ and it is not working.

@Redth
Copy link
Owner

Redth commented Apr 12, 2013

The trick is, Target Android version and Target Build Framework are not the same thing... the sample project by default targets 4.0.3, but the target build version was 2.2.

So there's really 3 places in the project config related to the android version:

  • General -> Target framework
  • Android Application -> Minimum Android version
  • Android Application -> Target Android version

@Redth
Copy link
Owner

Redth commented Apr 12, 2013

In the next release the sample code will be targeting the 2.3 framework by default so this confusing is minimized :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants