I know that the setFocusMode function in Camera.Parameters allows a programmer to control the camera focus.
But how do you know if that function will work on any particular phone? It might return NULL, meaning that the phone does not support foc开发者_如何学JAVAus control for its camera.
Its easy to tell which Android phones on the market have autofocus.
But if a manufacturer says their phone has autofocus, does that mean I can control the camera focus using setFocusMode?
I just don't want to buy a phone, and then find out setFocusMode does not change the focus.
If you are curious about what exactly I'm trying to do: I'd like to switch between FOCUS_MODE_INFINITY and FOCUS_MODE_MACRO and take two different pictures of an object.
thanks, SJK
Check whether it reports the autofocus feature: http://developer.android.com/reference/android/content/pm/PackageManager.html#FEATURE_CAMERA_AUTOFOCUS
This is the same feature used by Market to filter apps that require autofocus.
The most straightforward solution would be:
- Make a app that just prints "This phone has autofocus" or "This phone doesn't have autofocus" on the screen, depending on whether the result of setFocusMode.
- Publish the app on the android market.
- Ask the vendor to allow you to test that one app on the phone before purchasing.
If your vendor doesn't allow you to do so, then the next better thing is asking in forums. Something like "Hey guys, can anyone having this phone tell me what this app (link to app on Market) returns on it?
I suppose you could also ask the IT support for an specific phone to try the app for you. The results will depend on whether they have an app available for testing these things.
That's all I can think about.
精彩评论