# Lint Report

Check performed at Fri May 15 12:35:53 CEST 2015.
14 errors and 3 warnings found:

| Correctness
1 | InlinedApi: Using inlined constants on older versions
14 | NewApi: Calling new methods on older versions
1 | OldTargetApi: Target SDK attribute is not targeting latest version
1 | GradleOverrides: Value overridden by Gradle build script
| Disabled Checks (10)

Correctness
InlinedApi: Using inlined constants on older versions
../../src/main/java/org/opencv/android/JavaCameraView.java:157: Field requires API level 9 (current min is 8): `android.hardware.Camera.Parameters#FOCUS_MODE_CONTINUOUS_VIDEO`

     154                     List<String> FocusModes = params.getSupportedFocusModes();
     155                     if (FocusModes != null && FocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO))
     156                     {
     157                         params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
     158                     }
     159

Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Using inlined constants on older versions.
This check scans through all the Android API field references in the application and flags certain constants, such as static final integers and Strings, which were introduced in later versions. These will actually be copied into the class files rather than being referenced, which means that the value is available even when running on older devices. In some cases that's fine, and in other cases it can result in a runtime crash or incorrect behavior. It depends on the context, so consider the code carefully and device whether it's safe and can be suppressed or whether the code needs tbe guarded.
If you really want to use this API and don't need to support older devices just set the `minSdkVersion` in your `build.gradle` or `AndroidManifest.xml` files.
If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the `@TargetApi` annotation specifying the local minimum SDK to apply, such as `@TargetApi(11)`, such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.
More info:
To suppress this error, use the issue id "InlinedApi" as explained in the Suppressing Warnings and Errors section.
NewApi: Calling new methods on older versions
../../src/main/java/org/opencv/android/JavaCameraView.java:84: Call requires API level 9 (current min is 8): `android.hardware.Camera#getNumberOfCameras`

      81
      82                 if(mCamera == null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
      83                     boolean connected = false;
      84                     for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
      85                         Log.d(TAG, "Trying to open camera with new open(" + Integer.valueOf(camIdx) + ")");
      86                         try {

../../src/main/java/org/opencv/android/JavaCameraView.java:87: Call requires API level 9 (current min is 8): `android.hardware.Camera#open`

      84                     for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
      85                         Log.d(TAG, "Trying to open camera with new open(" + Integer.valueOf(camIdx) + ")");
      86                         try {
      87                             mCamera = Camera.open(camIdx);
      88                             connected = true;
      89                         } catch (RuntimeException e) {

../../src/main/java/org/opencv/android/JavaCameraView.java:100: Call requires API level 9 (current min is 8): `new android.hardware.Camera.CameraInfo`

      97                     int localCameraIndex = mCameraIndex;
      98                     if (mCameraIndex == CAMERA_ID_BACK) {
      99                         Log.i(TAG, "Trying to open back camera");
     100                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     101                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     102                             Camera.getCameraInfo( camIdx, cameraInfo );

../../src/main/java/org/opencv/android/JavaCameraView.java:101: Call requires API level 9 (current min is 8): `android.hardware.Camera#getNumberOfCameras`

      98                     if (mCameraIndex == CAMERA_ID_BACK) {
      99                         Log.i(TAG, "Trying to open back camera");
     100                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     101                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     102                             Camera.getCameraInfo( camIdx, cameraInfo );
     103                             if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {

../../src/main/java/org/opencv/android/JavaCameraView.java:102: Call requires API level 9 (current min is 8): `android.hardware.Camera#getCameraInfo`

      99                         Log.i(TAG, "Trying to open back camera");
     100                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     101                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     102                             Camera.getCameraInfo( camIdx, cameraInfo );
     103                             if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
     104                                 localCameraIndex = camIdx;

+ 9 More Occurrences...
../../src/main/java/org/opencv/android/JavaCameraView.java:103: Field requires API level 9 (current min is 8): `android.hardware.Camera.CameraInfo#facing`

     100                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     101                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     102                             Camera.getCameraInfo( camIdx, cameraInfo );
     103                             if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
     104                                 localCameraIndex = camIdx;
     105                                 break;

../../src/main/java/org/opencv/android/JavaCameraView.java:110: Call requires API level 9 (current min is 8): `new android.hardware.Camera.CameraInfo`

     107                         }
     108                     } else if (mCameraIndex == CAMERA_ID_FRONT) {
     109                         Log.i(TAG, "Trying to open front camera");
     110                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     111                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     112                             Camera.getCameraInfo( camIdx, cameraInfo );

../../src/main/java/org/opencv/android/JavaCameraView.java:111: Call requires API level 9 (current min is 8): `android.hardware.Camera#getNumberOfCameras`

     108                     } else if (mCameraIndex == CAMERA_ID_FRONT) {
     109                         Log.i(TAG, "Trying to open front camera");
     110                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     111                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     112                             Camera.getCameraInfo( camIdx, cameraInfo );
     113                             if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {

../../src/main/java/org/opencv/android/JavaCameraView.java:112: Call requires API level 9 (current min is 8): `android.hardware.Camera#getCameraInfo`

     109                         Log.i(TAG, "Trying to open front camera");
     110                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     111                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     112                             Camera.getCameraInfo( camIdx, cameraInfo );
     113                             if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
     114                                 localCameraIndex = camIdx;

../../src/main/java/org/opencv/android/JavaCameraView.java:113: Field requires API level 9 (current min is 8): `android.hardware.Camera.CameraInfo#facing`

     110                         Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
     111                         for (int camIdx = 0; camIdx < Camera.getNumberOfCameras(); ++camIdx) {
     112                             Camera.getCameraInfo( camIdx, cameraInfo );
     113                             if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
     114                                 localCameraIndex = camIdx;
     115                                 break;

../../src/main/java/org/opencv/android/JavaCameraView.java:126: Call requires API level 9 (current min is 8): `android.hardware.Camera#open`

     123                     } else {
     124                         Log.d(TAG, "Trying to open camera with new open(" + Integer.valueOf(localCameraIndex) + ")");
     125                         try {
     126                             mCamera = Camera.open(localCameraIndex);
     127                         } catch (RuntimeException e) {
     128                             Log.e(TAG, "Camera #" + localCameraIndex + "failed to open: " + e.getLocalizedMessage());

../../src/main/java/org/opencv/android/JavaCameraView.java:152: Call requires API level 14 (current min is 8): `android.hardware.Camera.Parameters#setRecordingHint`

     149                     params.setPreviewSize((int)frameSize.width, (int)frameSize.height);
     150
     151                     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && !android.os.Build.MODEL.equals("GT-I9100"))
     152                         params.setRecordingHint(true);
     153
     154                     List<String> FocusModes = params.getSupportedFocusModes();

../../src/main/java/org/opencv/android/JavaCameraView.java:193: Call requires API level 11 (current min is 8): `new android.graphics.SurfaceTexture`

     190                     mCameraFrame[1] = new JavaCameraFrame(mFrameChain[1], mFrameWidth, mFrameHeight);
     191
     192                     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
     193                         mSurfaceTexture = new SurfaceTexture(MAGIC_TEXTURE_ID);
     194                         mCamera.setPreviewTexture(mSurfaceTexture);
     195                     } else

../../src/main/java/org/opencv/android/JavaCameraView.java:194: Call requires API level 11 (current min is 8): `android.hardware.Camera#setPreviewTexture`

     191
     192                     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
     193                         mSurfaceTexture = new SurfaceTexture(MAGIC_TEXTURE_ID);
     194                         mCamera.setPreviewTexture(mSurfaceTexture);
     195                     } else
     196                        mCamera.setPreviewDisplay(null);

Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Priority: 6 / 10
Category: Correctness
Severity: Error
Explanation: Calling new methods on older versions.
This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest).
If you really want to use this API and don't need to support older devices just set the `minSdkVersion` in your `build.gradle` or `AndroidManifest.xml` files.
If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the `@TargetApi` annotation specifying the local minimum SDK to apply, such as `@TargetApi(11)`, such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.
If you are deliberately setting `android:` attributes in style definitions, make sure you place this in a `values-vNN` folder in order to avoid running into runtime conflicts on certain devices where manufacturers have added custom attributes whose ids conflict with the new ones on later platforms.
Similarly, you can use tools:targetApi="11" in an XML file to indicate that the element will only be inflated in an adequate context.
More info:
To suppress this error, use the issue id "NewApi" as explained in the Suppressing Warnings and Errors section.
OldTargetApi: Target SDK attribute is not targeting latest version
../../build.gradle:8: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.

       5
       6     defaultConfig {
       7         minSdkVersion 8
       8         targetSdkVersion 8

       9     }
      10

Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Priority: 6 / 10
Category: Correctness
Severity: Warning
Explanation: Target SDK attribute is not targeting latest version.
When your application runs on a version of Android that is more recent than your `targetSdkVersion` specifies that it has been tested with, various compatibility modes kick in. This ensures that your application continues to work, but it may look out of place. For example, if the `targetSdkVersion` is less than 14, your app may get an option button in the UI.
To fix this issue, set the `targetSdkVersion` to the highest available value. Then test your app to make sure everything works correctly. You may want to consult the compatibility notes to see what changes apply to each version you are adding support for: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
More info: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
To suppress this error, use the issue id "OldTargetApi" as explained in the Suppressing Warnings and Errors section.
GradleOverrides: Value overridden by Gradle build script
../../src/main/AndroidManifest.xml:7: This `minSdkVersion` value (`8`) is not used; it is always overridden by the value specified in the Gradle build script (`8`)

       4       android:versionCode="24110"
       5       android:versionName="2.4.11">
       6
       7     <uses-sdk android:minSdkVersion="8" />
       8 </manifest>
       9

Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Value overridden by Gradle build script.
The value of (for example) `minSdkVersion` is only used if it is not specified in the `build.gradle` build scripts. When specified in the Gradle build scripts, the manifest value is ignored and can be misleading, so should be removed to avoid ambiguity.
More info:
To suppress this error, use the issue id "GradleOverrides" as explained in the Suppressing Warnings and Errors section.
Disabled Checks
The following issues were not run by lint, either because the check is not enabled by default, or because it was disabled with a command line flag or via one or more lint.xml configuration files in the project directories.
BackButton
Disabled By: Default
Priority: 6 / 10
Category: Usability
Severity: Warning
Explanation: Back button.
According to the Android Design Guide,
"Other platforms use an explicit back button with label to allow the user to navigate up the application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical navigation and the navigation bar's back button for temporal navigation."
This check is not very sophisticated (it just looks for buttons with the label "Back"), so it is disabled by default to not trigger on common scenarios like pairs of Back/Next buttons to paginate through screens.
More info: http://developer.android.com/design/patterns/pure-android.html
To suppress this error, use the issue id "BackButton" as explained in the Suppressing Warnings and Errors section.
EasterEgg
Disabled By: Default
Priority: 6 / 10
Category: Security
Severity: Warning
Explanation: Code contains easter egg.
An "easter egg" is code deliberately hidden in the code, both from potential users and even from other developers. This lint check looks for code which looks like it may be hidden from sight.
More info:
To suppress this error, use the issue id "EasterEgg" as explained in the Suppressing Warnings and Errors section.
FieldGetter
Disabled By: Default
Priority: 4 / 10
Category: Performance
Severity: Warning
Explanation: Using getter instead of field.
Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.
NOTE: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.
More info: http://developer.android.com/guide/practices/design/performance.html#internal_get_set
To suppress this error, use the issue id "FieldGetter" as explained in the Suppressing Warnings and Errors section.
IconExpectedSize
Disabled By: Default
Priority: 5 / 10
Category: Usability:Icons
Severity: Warning
Explanation: Icon has incorrect size.
There are predefined sizes (for each density) for launcher icons. You should follow these conventions to make sure your icons fit in with the overall look of the platform.
More info: http://developer.android.com/design/style/iconography.html
To suppress this error, use the issue id "IconExpectedSize" as explained in the Suppressing Warnings and Errors section.
NegativeMargin
Disabled By: Default
Priority: 4 / 10
Category: Usability
Severity: Warning
Explanation: Negative Margins.
Margin values should be positive. Negative values are generally a sign that you are making assumptions about views surrounding the current one, or may be tempted to turn off child clipping to allow a view to escape its parent. Turning off child clipping to do this not only leads to poor graphical performance, it also results in wrong touch event handling since touch events are based strictly on a chain of parent-rect hit tests. Finally, making assumptions about the size of strings can lead to localization problems.
More info:
To suppress this error, use the issue id "NegativeMargin" as explained in the Suppressing Warnings and Errors section.
NewerVersionAvailable
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Default
Priority: 4 / 10
Category: Correctness
Severity: Warning
Explanation: Newer Library Versions Available.
This detector checks with a central repository to see if there are newer versions available for the dependencies used by this project.
This is similar to the `GradleDependency` check, which checks for newer versions available in the Android SDK tools and libraries, but this works with any MavenCentral dependency, and connects to the library every time, which makes it more flexible but also much slower.
More info:
To suppress this error, use the issue id "NewerVersionAvailable" as explained in the Suppressing Warnings and Errors section.
SelectableText
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Default
Priority: 7 / 10
Category: Usability
Severity: Warning
Explanation: Dynamic text should probably be selectable.
If a `<TextView>` is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the `<TextView>` should specify `android:textIsSelectable="true"`.
This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your `minSdkVersion`.
More info:
To suppress this error, use the issue id "SelectableText" as explained in the Suppressing Warnings and Errors section.
StopShip
Note: This issue has an associated quickfix operation in Android Studio/IntelliJ
Disabled By: Default
Priority: 10 / 10
Category: Correctness
Severity: Warning
Explanation: Code contains `STOPSHIP` marker.
Using the comment `// STOPSHIP` can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these.
More info:
To suppress this error, use the issue id "StopShip" as explained in the Suppressing Warnings and Errors section.
TypographyQuotes
Note: This issue has an associated quickfix operation in Eclipse/ADT & Android Studio/IntelliJ
Disabled By: Default
Priority: 5 / 10
Category: Usability:Typography
Severity: Warning
Explanation: Straight quotes can be replaced with curvy quotes.
Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.
Note that you should never use grave accents and apostrophes to quote, `like this'.
(Also note that you should not use curvy quotes for code fragments.)
More info: http://en.wikipedia.org/wiki/Quotation_mark
To suppress this error, use the issue id "TypographyQuotes" as explained in the Suppressing Warnings and Errors section.
UnusedIds
Disabled By: Default
Priority: 1 / 10
Category: Performance
Severity: Warning
Explanation: Unused id.
This resource id definition appears not to be needed since it is not referenced from anywhere. Having id definitions, even if unused, is not necessarily a bad idea since they make working on layouts and menus easier, so there is not a strong reason to delete these.
More info:
To suppress this error, use the issue id "UnusedIds" as explained in the Suppressing Warnings and Errors section.
Suppressing Warnings and Errors
Lint errors can be suppressed in a variety of ways:
1. With a @SuppressLint annotation in the Java code
2. With a tools:ignore attribute in the XML file
3. With a lint.xml configuration file in the project
4. With a lint.xml configuration file passed to lint via the --config flag
5. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a @SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources" or {"UnusedResources","UnusedIds"}, or it can be "all" to suppress all lint warnings in the given scope.
To suppress a lint warning in an XML file, add a tools:ignore="id" attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android declaration:
* xmlns:tools="http://schemas.android.com/tools"
To suppress lint warnings with a configuration XML file, create a file named lint.xml and place it at the root directory of the project in which it applies. (If you use the Eclipse plugin's Lint view, you can suppress errors there via the toolbar and Eclipse will create the lint.xml file for you.).
The format of the lint.xml file is something like the following:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable this given check in this project -->
<issue id="IconMissingDensityFolder" severity="ignore" />
<!-- Ignore the ObsoleteLayoutParam issue in the given files -->
<issue id="ObsoleteLayoutParam">
<ignore path="res/layout/activation.xml" />
<ignore path="res/layout-xlarge/activation.xml" />
</issue>
<!-- Ignore the UselessLeaf issue in the given file -->
<issue id="UselessLeaf">
<ignore path="res/layout/main.xml" />
</issue>
<!-- Change the severity of hardcoded strings to "error" -->
<issue id="HardcodedText" severity="error" />
</lint>
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
"lint --ignore UnusedResources,UselessLeaf /my/project/path"