I'm working on an Android application that need access to the front-facing camera on Samsung Galaxy Tab, with Android 2.2 (Froyo). As I've read from some forums, there is official support for the front camera, but only for the 2.3 version. I've read also that Samsung developed an API that makes use of the front camera, but I couldn't find anything about it.
I'd like to know if there is any way of accessing the front camera in the 2.2 version in the Samsung Galaxy Tab.
开发者_开发百科Thanks in advance,
Hugo
Edit - Oops this is for API level 9, so it won't work on Android 2.2
You can check for the number of cameras supported by using this API -
public static int getNumberOfCameras ()
Using the id retuned by the above api open that particular camera using the API -
public static Camera open (int cameraId)
More info here
The answer at Can I take a picture using the front camera on Samsung Galaxy Tab (Android 2.2) ? worked for me. I check Build.VERSION.SDK_INT to see which set of calls I need to make.
精彩评论