Lint Report

Check performed at Thu Dec 26 19:06:12 CST 2013.
2 errors and 38 warnings found:

Correctness
2 OnClick: onClick method does not exist
2 OldTargetApi: Target SDK attribute is not targeting latest version
4 SpUsage: Using dp instead of sp for text sizes
Security
2 AllowBackup: Missing allowBackup attribute
Performance
28 UnusedResources: Unused resources
2 UselessParent: Useless parent layout
Disabled Checks (11)

Correctness
OnClick: onClick method does not exist
/home/phodal/android/app/src/main/res/layout/ledview.xml:14: Corresponding method handler 'public void blinkLED(android.view.View)' not found
  11 	android:layout_centerVertical="true"
  12 	android:layout_centerHorizontal="true"
  13 	android:textSize="50dp"
  14 	android:onClick="blinkLED"></ToggleButton>
  15 </RelativeLayout>
  16 
/home/phodal/android/app/src/main/res/layout/ledview.xml:14: Corresponding method handler 'public void blinkLED(android.view.View)' not found
  11 	android:layout_centerVertical="true"
  12 	android:layout_centerHorizontal="true"
  13 	android:textSize="50dp"
  14 	android:onClick="blinkLED"></ToggleButton>
  15 </RelativeLayout>
  16 
Priority: 10 / 10
Category: Correctness
Severity: Error
Explanation: Ensures that onClick attribute values refer to real methods.
The onClick attribute value should be the name of a method in this View's context to invoke when the view is clicked. This name must correspond to a public method that takes exactly one parameter of type View.

Must be a string value, using '\;' to escape characters such as '\n' or '\uxxxx' for a unicode character.

More info:
To suppress this error, use the issue id "OnClick" as explained in the Suppressing Warnings and Errors section.
/home/phodal/android/app/src/main/AndroidManifest.xml:4: 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.
   1 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   2 	package="com.mokcy.hello" android:versionCode="1" android:versionName="1.0">
   3 	<uses-feature android:name="android.hardware.usb.accessory" />
   4 	<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
   5 
   6 	<uses-permission android:name="android.permission.INTERNET" />
/home/phodal/android/app/src/main/AndroidManifest.xml:4: 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.
   1 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
   2 	package="com.mokcy.hello" android:versionCode="1" android:versionName="1.0">
   3 	<uses-feature android:name="android.hardware.usb.accessory" />
   4 	<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
   5 
   6 	<uses-permission android:name="android.permission.INTERNET" />
Severity: Warning
Explanation: Checks that the manifest specifies a targetSdkVersion that is recent.
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


To suppress this error, use the issue id "OldTargetApi" as explained in the Suppressing Warnings and Errors section.
/home/phodal/android/app/src/main/res/layout/data_view.xml:13: Should use "sp" instead of "dp" for text sizes
  10 	android:layout_height="150dp"
  11 	android:layout_centerVertical="true"
  12 	android:layout_centerHorizontal="true"
  13 	android:textSize="50dp"
  14 	android:onClick="blinkLED"></ToggleButton>
  15 </RelativeLayout>
/home/phodal/android/app/src/main/res/layout/data_view.xml:13: Should use "sp" instead of "dp" for text sizes
  10 	android:layout_height="150dp"
  11 	android:layout_centerVertical="true"
  12 	android:layout_centerHorizontal="true"
  13 	android:textSize="50dp"
  14 	android:onClick="blinkLED"></ToggleButton>
  15 </RelativeLayout>
/home/phodal/android/app/src/main/res/layout/ledview.xml:13: Should use "sp" instead of "dp" for text sizes
  10 	android:layout_height="150dp"
  11 	android:layout_centerVertical="true"
  12 	android:layout_centerHorizontal="true"
  13 	android:textSize="50dp"
  14 	android:onClick="blinkLED"></ToggleButton>
  15 </RelativeLayout>
/home/phodal/android/app/src/main/res/layout/ledview.xml:13: Should use "sp" instead of "dp" for text sizes
  10 	android:layout_height="150dp"
  11 	android:layout_centerVertical="true"
  12 	android:layout_centerHorizontal="true"
  13 	android:textSize="50dp"
  14 	android:onClick="blinkLED"></ToggleButton>
  15 </RelativeLayout>
Severity: Warning
Explanation: Looks for uses of dp instead of sp dimensions for text sizes.
When setting text sizes, you should normally use sp, or "scale-independent pixels". This is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user's preference.

There are cases where you might need to use dp; typically this happens when the text is in a container with a specific dp-size. This will prevent the text from spilling outside the container. Note however that this means that the user's font size settings are not respected, so consider adjusting the layout itself to be more flexible.


To suppress this error, use the issue id "SpUsage" as explained in the Suppressing Warnings and Errors section.
Security
/home/phodal/android/app/src/main/AndroidManifest.xml:7: Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data)
   4 	<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
   5 
   6 	<uses-permission android:name="android.permission.INTERNET" />
   7 	<application android:icon="@drawable/ic_launcher"
   8 		android:label="@string/app_name" android:theme="@style/AppTheme">
   9 		<uses-library android:name="com.android.future.usb.accessory" />
/home/phodal/android/app/src/main/AndroidManifest.xml:7: Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data)
   4 	<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
   5 
   6 	<uses-permission android:name="android.permission.INTERNET" />
   7 	<application android:icon="@drawable/ic_launcher"
   8 		android:label="@string/app_name" android:theme="@style/AppTheme">
   9 		<uses-library android:name="com.android.future.usb.accessory" />
Severity: Warning
Explanation: Ensure that allowBackup is explicitly set in the application's manifest.
The allowBackup attribute determines if an application's data can be backed up and restored. It is documented at http://developer.android.com/reference/android/R.attr.html#allowBackup

By default, this flag is set to true. When this flag is set to true, application data can be backed up and restored by the user using adb backup and adb restore.

This may have security consequences for an application. adb backup allows users who have enabled USB debugging to copy application data off of the device. Once backed up, all application data can be read by the user. adb restore allows creation of application data from a source specified by the user. Following a restore, applications should not assume that the data, file permissions, and directory permissions were created by the application itself.

Setting allowBackup="false" opts an application out of both backup and restore.

To fix this warning, decide whether your application should support backup, and explicitly set android:allowBackup=(true|false)"


To suppress this error, use the issue id "AllowBackup" as explained in the Suppressing Warnings and Errors section.
Performance
/home/phodal/android/app/src/main/res/menu/activity_main.xml: The resource R.menu.activity_main appears to be unused
/home/phodal/android/app/src/main/res/menu/activity_main.xml: The resource R.menu.activity_main appears to be unused
/home/phodal/android/app/src/main/res/layout/data_view.xml: The resource R.layout.data_view appears to be unused
/home/phodal/android/app/src/main/res/layout/data_view.xml: The resource R.layout.data_view appears to be unused
/home/phodal/android/app/src/main/res/values/dimens.xml:3: The resource R.dimen.padding_small appears to be unused
   1 <resources>
   2 
   3     <dimen name="padding_small">8dp</dimen>
   4     <dimen name="padding_medium">8dp</dimen>
   5     <dimen name="padding_large">16dp</dimen>


    Severity: Warning
    Explanation: Looks for unused resources.
    Unused resources make applications larger and slow down builds.

    More info:
    To suppress this error, use the issue id "UnusedResources" as explained in the Suppressing Warnings and Errors section.
    /home/phodal/android/app/src/main/res/layout/activity_main.xml:8: This LinearLayout layout or its LinearLayout parent is useless
       5     android:layout_width="fill_parent"
       6     android:layout_height="fill_parent"
       7     android:padding="10dip" >
       8 	<LinearLayout 
       9 	    android:orientation="vertical"
      10 	    android:layout_height="wrap_content"
    
    /home/phodal/android/app/src/main/res/layout/activity_main.xml:8: This LinearLayout layout or its LinearLayout parent is useless
       5     android:layout_width="fill_parent"
       6     android:layout_height="fill_parent"
       7     android:padding="10dip" >
       8 	<LinearLayout 
       9 	    android:orientation="vertical"
      10 	    android:layout_height="wrap_content"
    
    Severity: Warning
    Explanation: Checks whether a parent layout can be removed.
    A layout with children that has no siblings, is not a scrollview or a root layout, and does not have a background, can be removed and have its children moved directly into the parent for a flatter and more efficient layout hierarchy.

    More info:
    To suppress this error, use the issue id "UselessParent" 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
    Severity: Warning
    Explanation: Looks for Back buttons, which are not common on the Android platform.
    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.


    To suppress this error, use the issue id "BackButton" as explained in the Suppressing Warnings and Errors section.
    EasterEgg
    Severity: Warning
    Explanation: Looks for hidden easter eggs.
    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
    Severity: Warning
    Explanation: Suggests replacing uses of getters with direct field access within a class.
    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.


    To suppress this error, use the issue id "FieldGetter" as explained in the Suppressing Warnings and Errors section.
    IconExpectedSize
    Severity: Warning
    Explanation: Ensures that launcher icons, notification icons etc have the correct 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.


    To suppress this error, use the issue id "IconExpectedSize" as explained in the Suppressing Warnings and Errors section.
    RtlCompat
    Severity: Error
    Explanation: Looks for compatibility issues with RTL support.
    API 17 adds a textAlignment attribute to specify text alignment. However, if you are supporting older versions than API 17, you must also specify a gravity or layout_gravity attribute, since older platforms will ignore the textAlignment attribute.

    More info:
    To suppress this error, use the issue id "RtlCompat" as explained in the Suppressing Warnings and Errors section.
    RtlEnabled
    Severity: Warning
    Explanation: Looks for usages of right-to-left text constants without enabling RTL support.
    To enable right-to-left support, when running on API 17 and higher, you must set the android:supportsRtl attribute in the manifest <application> element.
    If you have started adding RTL attributes, but have not yet finished the migration, you can set the attribute to false to satisfy this lint check.

    More info:
    To suppress this error, use the issue id "RtlEnabled" as explained in the Suppressing Warnings and Errors section.
    RtlHardcoded
    Severity: Warning
    Explanation: Looks for hardcoded left/right constants which could be start/end for bidirectional text.
    Using Gravity#LEFT and Gravity#RIGHT can lead to problems when a layout is rendered in locales where text flows from right to left. Use Gravity#START and Gravity#END instead. Similarly, in XML gravity and layout_gravity attributes, use start rather than left.
    For XML attributes such as paddingLeft and layout_marginLeft, use paddingStart and layout_marginStart. NOTE: If your minSdkVersion is less than 17, you should add both the older left/right attributes as well as the new start/right attributes. On older platforms, where RTL is not supported and the start/right attributes are unknown and therefore ignored, you need the older left/right attributes. There is a separate lint check which catches that type of error.
    (Note: For Gravity#LEFT and Gravity#START, you can use these constants even when targeting older platforms, because the start bitmask is a superset of the left bitmask. Therefore, you can use gravity="start" rather than gravity="left|start".)

    More info:
    To suppress this error, use the issue id "RtlHardcoded" as explained in the Suppressing Warnings and Errors section.
    SelectableText
    Severity: Warning
    Explanation: Looks for TextViews which should probably allow their text to be selected.
    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
    Severity: Warning
    Explanation: Looks for comment markers of the form //STOPSHIP which indicates that code should not be released yet.
    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
    Severity: Warning
    Explanation: Looks for straight quotes which can be replaced by 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.)


    To suppress this error, use the issue id "TypographyQuotes" as explained in the Suppressing Warnings and Errors section.
    UnusedIds
    Severity: Warning
    Explanation: Looks for unused id's.
    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"