如何检测,其中前置摄像头放置在设备? [英] How to detect where front-facing camera placed on device?

查看:165
本文介绍了如何检测,其中前置摄像头放置在设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有来检测前置摄像头放置的Andr​​oid设备上的任何方式?

Is there any ways to detect where front-facing camera placed on Android device?

我觉得在手机上它总是在它的上面,耳机附近。但所有的片剂都不同。我查了华硕变压器和前置摄像头的侧面(在上面,如果我在横向模式下持有它),但是三星Galaxy Tab(第一代的Andr​​oid 2.2)的相机在它上面,像所有的手机。

I think on cell phones it's always on top of it, near the headphone. But all tablets are different. I checked Asus Transformer, and front camera is on the side (on top if I hold it in landscape mode), but Samsung Galaxy Tab (first gen, Android 2.2) has camera on top of it, like all cell phones.

那么,有没有办法来检查,其中前置摄像头放在哪里?也许我可以用code做,也许有对设备的规则?如Android 2.x设备都有它的顶部和Android 3.x设备对端?那么关于Adnroid内4.x的设备?

So is there way to check where front camera placed? Maybe I can do it with code, maybe there is a rule for devices? Like Android 2.x devices has it on top, and Android 3.x devices has on the side? Then what about Adnroid 4.x devices?

推荐答案

有没有办法做到这一点。阅读的http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html

There is no way to do this. Read http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html

有两个常量,您可以检查:

There are two constants you can check:

int CAMERA_FACING_BACK The facing of the camera is opposite to that of the screen.
int CAMERA_FACING_FRONT The facing of the camera is the same as that of the screen.

所以,我很抱歉 - 来检查它是否在一旁没办法

So I'm sorry - no way to check if it's at the side.

这篇关于如何检测,其中前置摄像头放置在设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆