All,
I am developing an app that uses the phone camera, and I want to set
the Flash Mode, if flash exists.
>From documentation, it looks like I need to call
Camera.Parameters.getFlashMode() and check if it returns null to
determine if flash exists.
Note: getFlashMode() is supported from API level 5

However, when I try to run this app on a phone with cupcake, I get an
error:
01-19 14:02:43.404: ERROR/dalvikvm(18891): Could not find method
android.hardware.Camera$Parameters.getFlashMode, referenced from
method ...

I tried to call this code based on SDK version as follows, but that
does not work either. Looks like there is a class verification  thats
fails at init:

import android.os.Build.VERSION;
....
      int mSdkVersion = VERSION.SDK_INT;
      Camera.Parameters params = mCamera.getParameters();
      if (mSdkVersion >=5 && params.getFlashMode()!=null){
                        
params.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);//set auto
flash
      }

So now I am wondering if there is any other way to check if flash
exists? or is there a way to conditionally compile code based on
mSdkVersion?



-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to