Lint Report: 1 error and 88 warnings
Issue Types

Overview

Correctness
7warning Assert: Assertions
31warning DefaultLocale: Implied default locale in case conversion
1error InvalidPackage: Package not included in Android
2warning OldTargetApi: Target SDK attribute is not targeting latest version
2warning GradleDependency: Obsolete Gradle Dependency
2warning GradleOverrides: Value overridden by Gradle build script
1warning Deprecated: Using deprecated resources
Security
1warning AllowBackup: AllowBackup/FullBackupContent Problems
Performance
7warning NestedWeights: Nested layout weights
22warning UnusedResources: Unused resources
Usability
3warning ButtonStyle: Button should be borderless
1warning GoogleAppIndexingWarning: Missing support for Firebase App Indexing
Internationalization
2warning SetTextI18n: TextView Internationalization
7warning HardcodedText: Hardcoded text
Disabled Checks (21)

Assertions

../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:558: Assertions are unreliable. Use BuildConfig.DEBUG conditional checks instead.
  555         final long n = p.valuesSize();
  556         switch (p.packetType()) {
  557             case EEG:
  558                 assert(eegBuffer.length >= n);                                                      
  559                 getEegChannelValues(eegBuffer,p);
  560                 eegStale = true;
  561                 break;
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:563: Assertions are unreliable. Use BuildConfig.DEBUG conditional checks instead.
  560                 eegStale = true;
  561                 break;
  562             case ACCELEROMETER:
  563                 assert(accelBuffer.length >= n);                                                    
  564                 getAccelValues(p);
  565                 accelStale = true;
  566                 break;
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:569: Assertions are unreliable. Use BuildConfig.DEBUG conditional checks instead.
  566                 break;
  567 
  568             case ALPHA_RELATIVE://add
  569                 assert(alphaBuffer.length >= n);                                                    
  570                 getEegChannelValues(alphaBuffer,p);
  571                 alphaStale = true;
  572                 break;
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:574: Assertions are unreliable. Use BuildConfig.DEBUG conditional checks instead.
  571                 alphaStale = true;
  572                 break;
  573             case BETA_RELATIVE://add
  574                 assert(betaBuffer.length >= n);                                                     
  575                 getEegChannelValues(betaBuffer,p);
  576                 betaStale = true;
  577                 break;
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:579: Assertions are unreliable. Use BuildConfig.DEBUG conditional checks instead.
  576                 betaStale = true;
  577                 break;
  578             case THETA_RELATIVE://add
  579                 assert(thetaBuffer.length >= n);                                                    
  580                 getEegChannelValues(thetaBuffer,p);
  581                 thetaStale = true;
  582                 break;
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:584: Assertions are unreliable. Use BuildConfig.DEBUG conditional checks instead.
  581                 thetaStale = true;
  582                 break;
  583             case DELTA_RELATIVE://add
  584                 assert(deltaBuffer.length >= n);                                                    
  585                 getEegChannelValues(deltaBuffer,p);
  586                 deltaStale = true;
  587                 break;
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:589: Assertions are unreliable. Use BuildConfig.DEBUG conditional checks instead.
  586                 deltaStale = true;
  587                 break;
  588             case GAMMA_RELATIVE://add
  589                 assert(gammaBuffer.length >= n);                                                    
  590                 getEegChannelValues(gammaBuffer,p);
  591                 gammaStale = true;
  592                 break;
Assert Correctness Warning Priority 6/10

Implied default locale in case conversion

../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:708: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
  705      DatabaseReference gammaRef = database.getReference("Gamma_relative");
  706      */
  707     private void updateElem(double[] buffer,EEGsignal signal){
  708         signal.setElem1(String.format("%6.2f", buffer[0]));                                         
  709         signal.setElem2(String.format("%6.2f", buffer[1]));
  710         signal.setElem3(String.format("%6.2f", buffer[2]));
  711         signal.setElem4(String.format("%6.2f", buffer[3]));
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:709: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
  706      */
  707     private void updateElem(double[] buffer,EEGsignal signal){
  708         signal.setElem1(String.format("%6.2f", buffer[0]));
  709         signal.setElem2(String.format("%6.2f", buffer[1]));                                         
  710         signal.setElem3(String.format("%6.2f", buffer[2]));
  711         signal.setElem4(String.format("%6.2f", buffer[3]));
  712     }
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:710: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
  707     private void updateElem(double[] buffer,EEGsignal signal){
  708         signal.setElem1(String.format("%6.2f", buffer[0]));
  709         signal.setElem2(String.format("%6.2f", buffer[1]));
  710         signal.setElem3(String.format("%6.2f", buffer[2]));                                         
  711         signal.setElem4(String.format("%6.2f", buffer[3]));
  712     }
  713     private void updateAccel() {
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:711: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
  708         signal.setElem1(String.format("%6.2f", buffer[0]));
  709         signal.setElem2(String.format("%6.2f", buffer[1]));
  710         signal.setElem3(String.format("%6.2f", buffer[2]));
  711         signal.setElem4(String.format("%6.2f", buffer[3]));                                         
  712     }
  713     private void updateAccel() {
  714         TextView acc_x = (TextView)findViewById(R.id.acc_x);
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:717: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead
  714         TextView acc_x = (TextView)findViewById(R.id.acc_x);
  715         TextView acc_y = (TextView)findViewById(R.id.acc_y);
  716         TextView acc_z = (TextView)findViewById(R.id.acc_z);
  717         acc_x.setText(String.format("%6.2f", accelBuffer[0]));                                      
  718         acc_y.setText(String.format("%6.2f", accelBuffer[1]));
  719         acc_z.setText(String.format("%6.2f", accelBuffer[2]));
  720     }
DefaultLocale Correctness Warning Priority 6/10

Package not included in Android

../../../../../../../../../../../../.gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.11.0/840897fcd7223a8143f1d9b6f69714e7be34fd50/okio-1.11.0.jar: Invalid package reference in library; not included in Android: java.nio.file. Referenced from okio.Okio.
InvalidPackage Correctness Error Priority 6/10

Target SDK attribute is not targeting latest version

../../src/main/AndroidManifest.xml:15: 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.
 12 
 13     <uses-sdk
 14         android:minSdkVersion="15"
 15         android:targetSdkVersion="23" />                                                            
 16 
 17     <application
 18         android:allowBackup="true"
../../build.gradle:10: 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.
  7     defaultConfig {
  8         applicationId "com.choosemuse.example.libmuse2"
  9         minSdkVersion 15
 10         targetSdkVersion 23                                                                         
 11         compileOptions {
 12             sourceCompatibility JavaVersion.VERSION_1_7
 13             targetCompatibility JavaVersion.VERSION_1_7
OldTargetApi Correctness Warning Priority 6/10

Obsolete Gradle Dependency

../../build.gradle:5: Old buildToolsVersion 25.0.0; recommended version is 25.0.2 or later
  2 
  3 android {
  4     compileSdkVersion 23
  5     buildToolsVersion '25.0.0'                                                                      
  6 
  7     defaultConfig {
  8         applicationId "com.choosemuse.example.libmuse2"
../../build.gradle:33: A newer version of com.android.support:support-v4 than 23.1.1 is available: 25.3.0
 30 
 31 dependencies {
 32     compile files('libs/libmuse_android.jar')
 33     compile 'com.android.support:support-v4:23.1.1'                                                 
 34 
 35     compile('io.socket:socket.io-client:0.8.3') {
 36         exclude group: 'org.json', module: 'json'
GradleDependency Correctness Warning Priority 4/10

Value overridden by Gradle build script

../../src/main/AndroidManifest.xml:14: This minSdkVersion value (15) is not used; it is always overridden by the value specified in the Gradle build script (15)
 11     <uses-permission android:name="android.permission.INTERNET"/>
 12 
 13     <uses-sdk
 14         android:minSdkVersion="15"                                                                  
 15         android:targetSdkVersion="23" />
 16 
 17     <application
../../src/main/AndroidManifest.xml:15: This targetSdkVersion value (23) is not used; it is always overridden by the value specified in the Gradle build script (23)
 12 
 13     <uses-sdk
 14         android:minSdkVersion="15"
 15         android:targetSdkVersion="23" />                                                            
 16 
 17     <application
 18         android:allowBackup="true"
GradleOverrides Correctness Warning Priority 4/10

Using deprecated resources

../../src/main/res/layout/activity_login.xml:29: android:singleLine is deprecated: Use maxLines="1" instead
 26             android:inputType="textPersonName"
 27             android:maxLength="14"
 28             android:maxLines="1"
 29             android:singleLine="true"/>
                                                            
 30         <Button
 31             android:id="@+id/sign_in_button"
 32             style="?android:textAppearanceSmall"
Deprecated Correctness Warning Priority 2/10

AllowBackup/FullBackupContent Problems

../../src/main/AndroidManifest.xml:17: On SDK version 23 and up, your app data will be automatically backed up and restored on app install. Consider adding the attribute android:fullBackupContent to specify an @xml resource which configures which files to backup. More info: https://developer.android.com/training/backup/autosyncapi.html
 14         android:minSdkVersion="15"
 15         android:targetSdkVersion="23" />
 16 
 17     <application                                                                                    
 18         android:allowBackup="true"
 19         android:icon="@drawable/ic_launcher"
 20         android:label="@string/app_name"
AllowBackup Security Warning Priority 3/10

Nested layout weights

../../src/main/res/layout/activity_main.xml:92: Nested weights are bad for performance
  89             android:id="@+id/eeg_tp9"
  90             android:layout_width="match_parent"
  91             android:layout_height="match_parent"
  92             android:layout_weight="1"                                                                  
  93             android:textSize="16sp"
  94             android:text="@string/init_val" />
  95         <TextView
../../src/main/res/layout/activity_main.xml:136: Nested weights are bad for performance
 133             android:id="@+id/acc_x"
 134             android:layout_width="match_parent"
 135             android:layout_height="match_parent"
 136             android:layout_weight="1"                                                                        
 137             android:text="@string/init_val"
 138             android:textSize="16sp" />
../../src/main/res/layout/activity_main.xml:174: Nested weights are bad for performance
 171                 android:id="@+id/Aelem1"
 172                 android:layout_width="match_parent"
 173                 android:layout_height="match_parent"
 174                 android:layout_weight="1"                                                                 
 175                 android:textSize="16sp"
 176                 android:text="@string/init_val" />
 177             <TextView
../../src/main/res/layout/activity_main.xml:216: Nested weights are bad for performance
 213             android:id="@+id/Belem1"
 214             android:layout_width="match_parent"
 215             android:layout_height="match_parent"
 216             android:layout_weight="1"                                                                        
 217             android:textSize="16sp"
 218             android:text="@string/init_val" />
 219         <TextView
../../src/main/res/layout/activity_main.xml:258: Nested weights are bad for performance
 255             android:id="@+id/Telem1"
 256             android:layout_width="match_parent"
 257             android:layout_height="match_parent"
 258             android:layout_weight="1"                                                                        
 259             android:textSize="16sp"
 260             android:text="@string/init_val" />
 261         <TextView
../../src/main/res/layout/activity_main.xml:300: Nested weights are bad for performance
 297             android:id="@+id/Delem1"
 298             android:layout_width="match_parent"
 299             android:layout_height="match_parent"
 300             android:layout_weight="1"                                                                        
 301             android:textSize="16sp"
 302             android:text="@string/init_val" />
 303         <TextView
../../src/main/res/layout/activity_main.xml:343: Nested weights are bad for performance
 340             android:id="@+id/Gelem1"
 341             android:layout_width="match_parent"
 342             android:layout_height="match_parent"
 343             android:layout_weight="1"                                                                        
 344             android:textSize="16sp"
 345             android:text="@string/init_val" />
 346         <TextView
NestedWeights Performance Warning Priority 3/10

Unused resources

../../src/main/res/values/colors.xml:3: The resource R.color.colorPrimary appears to be unused
 1 <?xml version="1.0" encoding="utf-8"?>
 2 <resources>
 3     <color name="colorPrimary">#03A9F4</color>
                                                     
 4     <color name="colorPrimaryDark">#0288D1</color>
 5     <color name="colorAccent">#FF5722</color>
 6 </resources>
../../src/main/res/values/colors.xml:4: The resource R.color.colorPrimaryDark appears to be unused
 1 <?xml version="1.0" encoding="utf-8"?>
 2 <resources>
 3     <color name="colorPrimary">#03A9F4</color>
 4     <color name="colorPrimaryDark">#0288D1</color>
                                                 
 5     <color name="colorAccent">#FF5722</color>
 6 </resources>
../../src/main/res/values/colors.xml:5: The resource R.color.colorAccent appears to be unused
 2 <resources>
 3     <color name="colorPrimary">#03A9F4</color>
 4     <color name="colorPrimaryDark">#0288D1</color>
 5     <color name="colorAccent">#FF5722</color>
                                                      
 6 </resources>
../../src/main/res/menu/main.xml:1: The resource R.menu.main appears to be unused
  1 <menu xmlns:android="http://schemas.android.com/apk/res/android"                                    
  2     xmlns:tools="http://schemas.android.com/tools"
  3     tools:context="com.choosemuse.example.libmuse.MainActivity" >
../../src/main/res/values/strings.xml:7: The resource R.string.hello_world appears to be unused
  4     <string name="app_name">TestLibMuseAndroid</string>
  5     <string name="title_activity_login">Sign in</string>
  6 
  7     <string name="hello_world">Hello world!</string>                                                
  8     <string name="action_settings">Settings</string>
  9     <string name="connect">Connect</string>
 10     <string name="status">Connection Status:</string>
UnusedResources Performance Warning Priority 3/10

Button should be borderless

../../src/main/res/layout/activity_main.xml:15: Buttons in button bars should be borderless; use style="?android:attr/buttonBarButtonStyle" (and ?android:attr/buttonBarStyle on the parent)
  12         android:layout_width="match_parent"
  13         android:layout_height="45dp"
  14         android:orientation="horizontal" >
  15         <Button                                                                                     
  16             android:id="@+id/refresh"
  17             android:layout_width="100dp"
  18             android:layout_height="40dp"
../../src/main/res/layout/activity_main.xml:20: Buttons in button bars should be borderless; use style="?android:attr/buttonBarButtonStyle" (and ?android:attr/buttonBarStyle on the parent)
  17             android:layout_width="100dp"
  18             android:layout_height="40dp"
  19             android:text="@string/refresh" />
  20         <Button                                                                                        
  21             android:id="@+id/connect"
  22             android:layout_width="100dp"
  23             android:layout_height="40dp"
../../src/main/res/layout/activity_main.xml:25: Buttons in button bars should be borderless; use style="?android:attr/buttonBarButtonStyle" (and ?android:attr/buttonBarStyle on the parent)
  22             android:layout_width="100dp"
  23             android:layout_height="40dp"
  24             android:text="@string/connect" />
  25         <Button                                                                                        
  26             android:id="@+id/disconnect"
  27             android:layout_width="120dp"
  28             android:layout_height="40dp"
ButtonStyle Usability Warning Priority 5/10

Missing support for Firebase App Indexing

../../src/main/AndroidManifest.xml:17: App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details.
 14         android:minSdkVersion="15"
 15         android:targetSdkVersion="23" />
 16 
 17     <application                                                                                    
 18         android:allowBackup="true"
 19         android:icon="@drawable/ic_launcher"
 20         android:label="@string/app_name"
GoogleAppIndexingWarning Usability Warning Priority 5/10

TextView Internationalization

../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:1074: Do not concatenate text displayed with setText. Use resource string with placeholders.
 1071         }
 1072 
 1073         mUsername = data.getStringExtra("username");
 1074         mUserNameTx.setText("Hello "+ mUsername);                                                   
 1075         int numUsers = data.getIntExtra("numUsers", 1);
 1076 
 1077         //addLog(getResources().getString(R.string.message_welcome));
../../src/main/java/com/choosemuse/example/libmuse/MainActivity.java:1074: String literal in setText can not be translated. Use Android resources instead.
 1071         }
 1072 
 1073         mUsername = data.getStringExtra("username");
 1074         mUserNameTx.setText("Hello "+ mUsername);                                                   
 1075         int numUsers = data.getIntExtra("numUsers", 1);
 1076 
 1077         //addLog(getResources().getString(R.string.message_welcome));
SetTextI18n Internationalization Warning Priority 6/10

Hardcoded text

../../src/main/res/layout/activity_login.xml:36: [I18N] Hardcoded string "sign_in", should use @string resource
 33             android:layout_width="match_parent"
 34             android:layout_height="wrap_content"
 35             android:layout_marginTop="16dp"
 36             android:text="sign_in"
                                                                 
 37             android:textStyle="bold"/>
 38 
 39     </LinearLayout>
../../src/main/res/layout/activity_main.xml:53: [I18N] Hardcoded string "TextView", should use @string resource
  50         android:layout_marginLeft="8dp"
  51         android:layout_marginRight="8dp"
  52         android:layout_marginTop="8dp"
  53         android:text="TextView"                                                                           
  54          />
  55 
  56     <TextView
../../src/main/res/layout/activity_main.xml:64: [I18N] Hardcoded string "TextView", should use @string resource
  61         android:layout_marginLeft="8dp"
  62         android:layout_marginRight="8dp"
  63         android:layout_marginTop="8dp"
  64         android:text="TextView"                                                                           
  65          />
  66 
  67     <com.github.mikephil.charting.charts.LineChart
../../src/main/res/layout/activity_main.xml:206: [I18N] Hardcoded string "BETA relative", should use @string resource
 203         android:layout_height="match_parent"
 204         android:layout_weight="1"
 205         android:textSize="16sp"
 206         android:text="BETA relative" />                                                                   
 207     <LinearLayout
 208         android:layout_width="match_parent"
 209         android:layout_height="match_parent"
../../src/main/res/layout/activity_main.xml:248: [I18N] Hardcoded string "THETA relative", should use @string resource
 245         android:layout_height="match_parent"
 246         android:layout_weight="1"
 247         android:textSize="16sp"
 248         android:text="THETA relative" />                                                                  
 249     <LinearLayout
 250         android:layout_width="match_parent"
 251         android:layout_height="match_parent"
../../src/main/res/layout/activity_main.xml:290: [I18N] Hardcoded string "DELTA relative", should use @string resource
 287         android:layout_height="match_parent"
 288         android:layout_weight="1"
 289         android:textSize="16sp"
 290         android:text="DELTA relative" />                                                                  
 291     <LinearLayout
 292         android:layout_width="match_parent"
 293         android:layout_height="match_parent"
../../src/main/res/layout/activity_main.xml:332: [I18N] Hardcoded string "GAMMA relative", should use @string resource
 329         android:layout_height="match_parent"
 330         android:layout_weight="1"
 331         android:textSize="16sp"
 332         android:text="GAMMA relative" />                                                                  
 333 
 334     <LinearLayout
 335         android:layout_width="match_parent"
HardcodedText Internationalization Warning Priority 5/10

Disabled Checks

One or more 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.

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 //noinspection comment in the source code
4. With ignore flags specified in the build.gradle file, as explained below
5. With a lint.xml configuration file in the project
6. With a lint.xml configuration file passed to lint via the --config flag
7. 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 with a comment, add a //noinspection id comment on the line before the statement with the error.

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 a lint warning in a build.gradle file, add a section like this:

android {
    lintOptions {
        disable 'TypographyFractions','TypographyQuotes'
    }
}

Here we specify a comma separated list of issue id's after the disable command. You can also use warning or error instead of disable to change the severity of issues.

To suppress lint warnings with a configuration XML file, create a file named lint.xml and place it at the root directory of the module in which it applies.

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

For more information, see http://g.co/androidstudio/suppressing-lint-warnings