Overview
| Correctness | |
| 5 | warning DefaultLocale: Implied default locale in case conversion |
| 1 | warning OldTargetApi: Target SDK attribute is not targeting latest version |
| 1 | warning
UnspecifiedRegisterReceiverFlag: Missing registerReceiver() exported flag |
| 5 | warning GradleDependency: Obsolete Gradle Dependency |
| 10 | warning Deprecated: Using deprecated resources |
| Security | |
| 2 | warning HardwareIds: Hardware Id Usage |
| 2 | warning
SSLCertificateSocketFactoryGetInsecure: Call to SSLCertificateSocketFactory.getInsecure() |
| 1 | warning ExportedService: Exported service does not require permission |
| Performance | |
| 1 | warning
Wakelock: Incorrect WakeLock usage |
| 1 | warning WakelockTimeout: Using wakeLock without timeout |
| 8 | warning ObsoleteLayoutParam: Obsolete layout params |
| 5 | warning ObsoleteSdkInt: Obsolete SDK_INT Version Check |
| 1 | warning StaticFieldLeak: Static Field Leaks |
| 1 | warning HandlerLeak: Handler reference leaks |
| 16 | warning
UseValueOf: Should use valueOf instead of new |
| 5 | warning InefficientWeight: Inefficient layout weight |
| 1 | warning Overdraw: Overdraw: Painting regions more than once |
| 72 | warning UnusedResources: Unused resources |
| 1 | warning RedundantNamespace: Redundant namespace |
| 1 | warning UnusedNamespace: Unused namespace |
| Usability:Icons | |
| 3 | warning IconColors: Icon colors do not follow the recommended visual style |
| 3 | warning IconDensities: Icon densities validation |
| Usability | |
| 3 | warning ButtonOrder: Button order |
| 9 | warning ButtonStyle: Button should be borderless |
| 4 | warning
TextFields: Missing inputType |
| 8 | warning Autofill: Use Autofill |
| Accessibility | |
| 8 | warning LabelFor: Missing accessibility label |
| Internationalization | |
| 43 | warning SetTextI18n: TextView Internationalization |
| 14 | warning HardcodedText: Hardcoded text |
| Internationalization:Bidirectional Text | |
| 9 | warning RtlHardcoded: Using left/right instead of start/end attributes |
| Included Additional Checks (26) | |
| Disabled Checks (39) |
Implied default locale in case conversion
../../src/main/java/com/dwanta/android/dap/client/dpsmsg.java:318:
315 public boolean set( int id, int value ) { 316 byte[] b = new byte[25]; 317 // String.format(Locale, ...) instead [DefaultLocale] 318 String s = String.format("%d", value); 319 return this.set( id, s); 320 }../../src/main/java/com/dwanta/android/dap/client/dpsmsg.java:885:
882 if( field_def[id][0] == short_length ) { 883 byte[] f = fields.get(id); 884 byte[] f2 = new byte[f.length + 2]; 885 lenbuf = lenbuf.format("%02d", f.length); 886 strncpy( f2, lenbuf, 2, 0 ); 887 bytecpy( f2, f, f.length, 2 );../../src/main/java/com/dwanta/android/dap/client/dpsmsg.java:895:
892 if( field_def[id][0] == long_length ) { 893 byte[] f = fields.get(id); 894 byte[] f2 = new byte[f.length + 3]; 895 lenbuf = lenbuf.format("%03d", f.length); 896 strncpy( f2, lenbuf, 3, 0 ); 897 //Log.d(TAG, "f2 = " + new String(f2) + " len " + f.length); 898 bytecpy( f2, f, f.length, 3 );../../src/main/java/com/dwanta/android/dap/client/dpsmsg.java:905:
902 if( field_def[id][0] == vlong_length ) { 903 byte[] f = fields.get(id); 904 byte[] f2 = new byte[f.length + 6]; 905 lenbuf = lenbuf.format("%06d", f.length); 906 strncpy( f2, lenbuf, 6, 0 ); 907 bytecpy( f2, f, f.length, 6 );../../src/main/java/com/dwanta/android/dap/client/dpsmsg.java:941:
938 939 Log.d(TAG, "message start " + outbuf.array() ); 940 941 lenbuf = lenbuf.format("%04d", messageType); 942 byte[] m2 = new byte[4]; 943 strncpy( m2, lenbuf, 4, 0 ); 944 outbuf.put(m2);
DefaultLocale
Correctness
Warning
Priority 6/10
Target SDK attribute is not targeting latest version
../../build.gradle:17:
14 defaultConfig { 15 applicationId "com.dwanta.android.dap" 16 minSdk 28 17 targetSdk 33 18 versionCode 1 19 versionName "1.0"
OldTargetApi
Correctness
Warning
Priority 6/10
Missing registerReceiver() exported flag
../../src/main/java/com/dwanta/android/dap/client/ClientService.java:1221:
1218 IntentFilter filter = new IntentFilter(); 1219 //filter.addAction(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION); 1220 filter.addAction("DAPWAKE"); 1221 registerReceiver(mBroadcastReceiver, filter, null, null); 1222 //registerReceiver(mBroadcastReceiver, null, null, null); 1223 }
UnspecifiedRegisterReceiverFlag
Correctness
Warning
Priority 5/10
Obsolete Gradle Dependency
../../build.gradle:34:
31 sourceCompatibility JavaVersion.VERSION_11 32 targetCompatibility JavaVersion.VERSION_11 33 } 34 compileSdkVersion 34 35 36 namespace 'com.dwanta.android.dap' 37 }../../build.gradle:41:
38 39 dependencies { 40 41 implementation 'androidx.appcompat:appcompat:1.7.0' 42 implementation 'com.google.android.material:material:1.4.0' 43 //noinspection GradleDynamicVersion 44 testImplementation 'junit:junit:4.+'../../build.gradle:42:
39 dependencies { 40 41 implementation 'androidx.appcompat:appcompat:1.7.0' 42 implementation 'com.google.android.material:material:1.4.0' 43 //noinspection GradleDynamicVersion 44 testImplementation 'junit:junit:4.+' 45 androidTestImplementation 'androidx.test.ext:junit:1.1.3'../../build.gradle:45:
42 implementation 'com.google.android.material:material:1.4.0' 43 //noinspection GradleDynamicVersion 44 testImplementation 'junit:junit:4.+' 45 androidTestImplementation 'androidx.test.ext:junit:1.1.3' 46 androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 47 }../../build.gradle:46:
43 //noinspection GradleDynamicVersion 44 testImplementation 'junit:junit:4.+' 45 androidTestImplementation 'androidx.test.ext:junit:1.1.3' 46 androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 47 }
GradleDependency
Correctness
Warning
Priority 4/10
Using deprecated resources
../../src/main/res/layout/login_activity.xml:57:
54 android:layout_height="wrap_content" 55 android:minWidth="250dip" 56 android:scrollHorizontally="true" 57 android:capitalize="none" 58 android:autoText="false" 59 android:inputType="text" 60 />../../src/main/res/layout/login_activity.xml:58:
55 android:minWidth="250dip" 56 android:scrollHorizontally="true" 57 android:capitalize="none" 58 android:autoText="false" 59 android:inputType="text" 60 /> 61 <TextView../../src/main/res/layout/login_activity.xml:74:
71 android:layout_height="wrap_content" 72 android:minWidth="250dip" 73 android:scrollHorizontally="true" 74 android:capitalize="none" 75 android:autoText="false" 76 android:inputType="textEmailAddress" 77 />../../src/main/res/layout/login_activity.xml:75:
72 android:minWidth="250dip" 73 android:scrollHorizontally="true" 74 android:capitalize="none" 75 android:autoText="false" 76 android:inputType="textEmailAddress" 77 /> 78 <TextView../../src/main/res/layout/login_activity.xml:100:
97 android:layout_height="wrap_content" 98 android:minWidth="250dip" 99 android:scrollHorizontally="true" 100 android:capitalize="none" 101 android:autoText="false" 102 android:password="true" 103 android:inputType="textPassword"+ 5 More Occurrences...
Deprecated
Correctness
Warning
Priority 2/10
Hardware Id Usage
../../src/main/java/com/dwanta/android/dap/client/dpsio.java:1043:
1040 String serial = null; 1041 1042 if(Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) 1043 serial = Build.SERIAL; 1044 1045 if( serial != null ) 1046 return "03" + serial;../../src/main/java/com/dwanta/android/dap/client/dpsio.java:1048:
1045 if( serial != null ) 1046 return "03" + serial; 1047 1048 String androidId = Secure.getString(ctx.getContentResolver(), Secure.ANDROID_ID); 1049 1050 if(androidId != null) 1051 return "02" + androidId;
HardwareIds
Security
Warning
Priority 6/10
Call to SSLCertificateSocketFactory.getInsecure()
../../src/main/java/com/dwanta/android/dap/client/ClientService.java:1767:
1764 sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); 1765 1766 SSLCertificateSocketFactory sf = 1767 (SSLCertificateSocketFactory)SSLCertificateSocketFactory.getInsecure(10000, null); 1768 1769 Log.d(TAG, "after sf");../../src/main/java/com/dwanta/android/dap/client/ClientService.java:1869:
1866 sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); 1867 1868 SSLCertificateSocketFactory sf = 1869 (SSLCertificateSocketFactory)SSLCertificateSocketFactory.getInsecure(10000, null); 1870 Log.d(TAG, "after sf"); 1871 1872 //sf = (SSLCertificateSocketFactory)SSLCertificateSocketFactory.getInsecure(10000, null);
SSLCertificateSocketFactoryGetInsecure
Security
Warning
Priority 6/10
Exported service does not require permission
../../src/main/AndroidManifest.xml:49:
46 <!-- The view notification service --> 47 48 49 <service android:name=".client.ClientService" android:stopWithTask="true" android:exported="true" /> 50 51 52 <activity android:name=".activities.SiteActivity"
ExportedService
Security
Warning
Priority 5/10
Incorrect WakeLock usage
../../src/main/java/com/dwanta/android/dap/client/ClientService.java:1652:
1649 PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE); 1650 PowerManager.WakeLock wl = null; 1651 wl = pm.newWakeLock( PowerManager.FULL_WAKE_LOCK, "ClientService:FullWakeTag"); 1652 wl.acquire(); 1653 Log.d(TAG, "doOpenSocket WAKE_LOCK"); 1654
Wakelock
Performance
Warning
Priority 9/10
Using wakeLock without timeout
../../src/main/java/com/dwanta/android/dap/client/ClientService.java:1652:
1649 PowerManager pm = (PowerManager) ctx.getSystemService(Context.POWER_SERVICE); 1650 PowerManager.WakeLock wl = null; 1651 wl = pm.newWakeLock( PowerManager.FULL_WAKE_LOCK, "ClientService:FullWakeTag"); 1652 wl.acquire(); 1653 Log.d(TAG, "doOpenSocket WAKE_LOCK"); 1654
WakelockTimeout
Performance
Warning
Priority 9/10
Obsolete layout params
../../src/main/res/layout/confirm_activity.xml:31:
28 <LinearLayout 29 android:layout_width="fill_parent" 30 android:layout_height="wrap_content" 31 android:layout_weight="1" 32 android:orientation="vertical" 33 android:paddingTop="5dip" 34 android:paddingBottom="13dip"../../src/main/res/layout/dapmain.xml:43:
40 android:id="@+id/mainframe2" 41 android:layout_width="fill_parent" 42 android:layout_height="wrap_content" 43 android:layout_weight="1" 44 android:orientation="vertical" 45 android:paddingTop="5dip" 46 android:paddingBottom="13dip"../../src/main/res/layout/dechomain.xml:47:
44 <ScrollView 45 android:layout_width="fill_parent" 46 android:layout_height="0dip" 47 android:layout_weight="1"> 48 49 <LinearLayout 50 android:id="@+id/mainframe2"../../src/main/res/layout/dechomain.xml:53:
50 android:id="@+id/mainframe2" 51 android:layout_width="fill_parent" 52 android:layout_height="wrap_content" 53 android:layout_weight="1" 54 android:orientation="vertical" 55 android:paddingTop="5dip" 56 android:paddingBottom="13dip"../../src/main/res/layout/login_activity.xml:32:
29 <LinearLayout 30 android:layout_width="fill_parent" 31 android:layout_height="wrap_content" 32 android:layout_weight="1" 33 android:orientation="vertical" 34 android:paddingTop="5dip" 35 android:paddingBottom="13dip"../../src/main/res/layout/pin_activity.xml:31:
28 <LinearLayout 29 android:layout_width="fill_parent" 30 android:layout_height="wrap_content" 31 android:layout_weight="1" 32 android:orientation="vertical" 33 android:paddingTop="5dip" 34 android:paddingBottom="13dip"../../src/main/res/layout/prompt_activity.xml:32:
29 android:id="@+id/prompt_frame" 30 android:layout_width="fill_parent" 31 android:layout_height="wrap_content" 32 android:layout_weight="1" 33 android:orientation="vertical" 34 android:paddingTop="5dip" 35 android:paddingBottom="13dip"../../src/main/res/layout/sitemain.xml:39:
36 android:id="@+id/siteframe2" 37 android:layout_width="fill_parent" 38 android:layout_height="wrap_content" 39 android:layout_weight="1" 40 android:orientation="vertical" 41 android:paddingTop="5dip" 42 android:paddingBottom="13dip"
ObsoleteLayoutParam
Performance
Warning
Priority 6/10
Obsolete SDK_INT Version Check
../../src/main/java/com/dwanta/android/dap/client/dpsio.java:1042:
../../src/main/res/values-v21:
../../src/main/res/xml-v11:
../../src/main/res/xml-v14:
1039 public String getDeviceID() { 1040 String serial = null; 1041 1042 if(Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) 1043 serial = Build.SERIAL; 1044 1045 if( serial != null )../../src/main/res/values-v11:
../../src/main/res/values-v21:
../../src/main/res/xml-v11:
../../src/main/res/xml-v14:
ObsoleteSdkInt
Performance
Warning
Priority 6/10
Static Field Leaks
../../src/main/java/com/dwanta/android/dap/authenticator/AuthenticatorActivity.java:557:
554 * Represents an asynchronous task used to authenticate a user against the 555 * SampleSync Service 556 */ 557 public class UserLoginTask extends AsyncTask<Void, Void, String> { 558 559 private Context ctx; 560 private TextView statusTxtView;
StaticFieldLeak
Performance
Warning
Priority 6/10
Handler reference leaks
../../src/main/java/com/dwanta/android/dap/client/dpscamera.java:377:
374 /** 375 * A {@link Handler} for showing {@link Toast}s. 376 */ 377 private Handler mMessageHandler = new Handler() { 378 @Override 379 public void handleMessage(Message msg) { 380 Log.d(TAG, "handleMessage");
HandlerLeak
Performance
Warning
Priority 4/10
Should use valueOf instead of new
../../src/main/java/com/dwanta/android/dap/client/ClientService.java:1552:
1549 } else { 1550 if( msg.test(dpsmsg.amount) ) { 1551 try { 1552 float m = new Float(new String(msg.get(dpsmsg.amount))).floatValue(); 1553 t += " amt $" + m; 1554 } catch (Exception e) { 1555 Log.d(TAG, "bad amount " + new String(msg.get(dpsmsg.amount)));../../src/main/java/com/dwanta/android/dap/client/ClientServiceActivities.java:151:
148 ll2.setOrientation(LinearLayout.VERTICAL); 149 TextView tv2 = new TextView(this); 150 tv2.setText(msg.getPromptText(i)); 151 int p = new Integer(msg.getPromptId(i)).intValue(); 152 int len = new Integer(msg.getPromptLen(i)).intValue(); 153 if( len == 0 ) len = 8;../../src/main/java/com/dwanta/android/dap/client/ClientServiceActivities.java:152:
149 TextView tv2 = new TextView(this); 150 tv2.setText(msg.getPromptText(i)); 151 int p = new Integer(msg.getPromptId(i)).intValue(); 152 int len = new Integer(msg.getPromptLen(i)).intValue(); 153 if( len == 0 ) len = 8; 154 155 ll2.addView(tv2);../../src/main/java/com/dwanta/android/dap/client/ClientServiceActivities.java:233:
230 if( ( numPrompts > 0 ) && ( promptKey != "0" ) ) { 231 resp = promptKey + ","; 232 for( int i = 0; i < numPrompts; i++ ) { 233 int p = new Integer(msg.getPromptId(i)).intValue(); 234 Log.d(TAG, "looking for prompt " + p); 235 EditText promptEdit = (EditText)findViewById(p); 236 String text = "";../../src/main/java/com/dwanta/android/dap/activities/DechoActivity.java:267:
264 try { 265 String which = obj.getString("which"); 266 String val = obj.getString("value"); 267 int i2 = new Integer(which).intValue(); 268 Log.d(TAG, "MESSAGE2 have which " + which); 269 if( mTestInt == 4 ) { 270 Log.d(TAG, "was in menu");+ 11 More Occurrences...
UseValueOf
Performance
Warning
Priority 4/10
Inefficient layout weight
../../src/main/res/layout/channel.xml:49:
46 android:text="New Value" 47 /> 48 49 <EditText android:layout_height="wrap_content" 50 android:layout_width="match_parent" 51 android:layout_weight="1" 52 android:id="@+id/channelStatus"/>../../src/main/res/layout/siteprice.xml:43:
40 android:text="Enter Price" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productprice"/>../../src/main/res/layout/siteprod.xml:35:
32 android:text="Enter Product ID" 33 /> 34 35 <Spinner android:layout_height="wrap_content" 36 android:layout_width="match_parent" 37 android:layout_weight="1" 38 android:drawSelectorOnTop = "true"../../src/main/res/layout/siteqty.xml:43:
40 android:text="Enter Qty" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productqty"/>../../src/main/res/layout/sitesubprod.xml:35:
32 android:text="Enter Product ID" 33 /> 34 35 <Spinner android:layout_height="wrap_content" 36 android:layout_width="match_parent" 37 android:layout_weight="1" 38 android:id="@+id/productSpinner"/>
InefficientWeight
Performance
Warning
Priority 3/10
Overdraw: Painting regions more than once
../../src/main/res/layout/activity_camera.xml:21:
18 android:id="@+id/container" 19 android:layout_width="match_parent" 20 android:layout_height="match_parent" 21 android:background="#000" 22 tools:context="com.dwanta.android.dap.activities.CameraActivity" />
Overdraw
Performance
Warning
Priority 3/10
Unused resources
../../src/main/res/layout/activity_camera.xml:16:
13 See the License for the specific language governing permissions and 14 limitations under the License. 15 --> 16 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 17 xmlns:tools="http://schemas.android.com/tools" 18 android:id="@+id/container" 19 android:layout_width="match_parent"../../src/main/res/values/colors.xml:4:
1 <?xml version="1.0" encoding="utf-8"?> 2 <resources> 3 4 <color name="my_spinner_text_color">#808080</color> 5 6 </resources>../../src/main/res/xml/contacts.xml:20:
17 */ 18 --> 19 20 <ContactsSource 21 xmlns:android="http://schemas.android.com/apk/res/android" 22 >../../src/main/res/values/dimens.xml:23:
20 <resources> 21 22 <!-- Font size used for the contact name in the editor --> 23 <dimen name="contact_name_text_size">18sp</dimen> 24 25 </resources>../../src/main/res/layout/fragment_camera2_basic.xml:16:
13 See the License for the specific language governing permissions and 14 limitations under the License. 15 --> 16 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 17 android:layout_width="match_parent" 18 android:layout_height="match_parent">+ 67 More Occurrences...
UnusedResources
Performance
Warning
Priority 3/10
Redundant namespace
../../src/main/res/layout/main.xml:8:
5 android:orientation="vertical" > 6 7 <LinearLayout 8 xmlns:android="http://schemas.android.com/apk/res/android" 9 android:id="@+id/login_activity" 10 android:layout_width="fill_parent" 11 android:layout_height="fill_parent"
RedundantNamespace
Performance
Warning
Priority 1/10
Unused namespace
../../src/main/res/layout/main.xml:8:
5 android:orientation="vertical" > 6 7 <LinearLayout 8 xmlns:android="http://schemas.android.com/apk/res/android" 9 android:id="@+id/login_activity" 10 android:layout_width="fill_parent" 11 android:layout_height="fill_parent"
UnusedNamespace
Performance
Warning
Priority 1/10
Icon colors do not follow the recommended visual style
../../src/main/res/drawable-hdpi/icon.png:
../../src/main/res/drawable-ldpi/icon.png:
../../src/main/res/drawable-mdpi/icon.png:
1614 Notification notification = new Notification.Builder(this). 1615 setContentTitle(text). 1616 setContentText("Touch to manage DAP service."). 1617 setSmallIcon(R.drawable.icon). 1618 setTicker("DAP started"). 1619 setOngoing(true). 1620 setChannelId(channelid).
| hdpi |
|---|
1614 Notification notification = new Notification.Builder(this). 1615 setContentTitle(text). 1616 setContentText("Touch to manage DAP service."). 1617 setSmallIcon(R.drawable.icon). 1618 setTicker("DAP started"). 1619 setOngoing(true). 1620 setChannelId(channelid).
| ldpi |
|---|
1614 Notification notification = new Notification.Builder(this). 1615 setContentTitle(text). 1616 setContentText("Touch to manage DAP service."). 1617 setSmallIcon(R.drawable.icon). 1618 setTicker("DAP started"). 1619 setOngoing(true). 1620 setChannelId(channelid).
| mdpi |
|---|
IconColors
Icons
Usability
Warning
Priority 6/10
Icon densities validation
IconDensities
Icons
Usability
Warning
Priority 4/10
Button order
../../src/main/res/layout/login_activity.xml:130:
127 android:minWidth="100dip" 128 android:text="@string/login_activity_ok_button" 129 android:onClick="handleLogin" /> 130 <Button 131 android:id="@+id/cancel_button" 132 android:layout_width="wrap_content" 133 android:layout_height="wrap_content"../../src/main/res/layout/pin_activity.xml:85:
82 android:minWidth="50dip" 83 android:text="@string/pin_activity_ok_button" 84 /> 85 <Button 86 android:id="@+id/cancel_button" 87 android:layout_width="wrap_content" 88 android:layout_height="wrap_content"../../src/main/res/layout/prompt_activity.xml:56:
53 android:minWidth="100dip" 54 android:text="Send Prompt" 55 /> 56 <Button 57 android:id="@+id/cancel_button" 58 android:layout_width="wrap_content" 59 android:layout_height="wrap_content"
ButtonOrder
Usability
Warning
Priority 8/10
Button should be borderless
../../src/main/res/layout/login_activity.xml:122:
119 android:paddingLeft="2dip" 120 android:orientation="horizontal" 121 android:paddingRight="2dip"> 122 <Button 123 android:id="@+id/ok_button" 124 android:layout_width="wrap_content" 125 android:layout_height="wrap_content"../../src/main/res/layout/login_activity.xml:130:
127 android:minWidth="100dip" 128 android:text="@string/login_activity_ok_button" 129 android:onClick="handleLogin" /> 130 <Button 131 android:id="@+id/cancel_button" 132 android:layout_width="wrap_content" 133 android:layout_height="wrap_content"../../src/main/res/layout/pin_activity.xml:78:
75 android:paddingLeft="2dip" 76 android:orientation="horizontal" 77 android:paddingRight="2dip"> 78 <Button 79 android:id="@+id/ok_button" 80 android:layout_width="wrap_content" 81 android:layout_height="wrap_content"../../src/main/res/layout/pin_activity.xml:85:
82 android:minWidth="50dip" 83 android:text="@string/pin_activity_ok_button" 84 /> 85 <Button 86 android:id="@+id/cancel_button" 87 android:layout_width="wrap_content" 88 android:layout_height="wrap_content"../../src/main/res/layout/prompt_activity.xml:48:
45 android:paddingTop="4dip" 46 android:paddingLeft="2dip" 47 android:paddingRight="2dip"> 48 <Button 49 android:id="@+id/ok_button" 50 android:layout_width="wrap_content" 51 android:layout_height="wrap_content"+ 4 More Occurrences...
ButtonStyle
Usability
Warning
Priority 5/10
Missing inputType
../../src/main/res/layout/channel.xml:49:
46 android:text="New Value" 47 /> 48 49 <EditText android:layout_height="wrap_content" 50 android:layout_width="match_parent" 51 android:layout_weight="1" 52 android:id="@+id/channelStatus"/>../../src/main/res/layout/sitecard.xml:21:
18 android:text="Card #" 19 /> 20 21 <EditText 22 android:id="@+id/carddpsid_id" 23 android:layout_width="match_parent" 24 android:layout_height="wrap_content"../../src/main/res/layout/siteprice.xml:43:
40 android:text="Enter Price" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productprice"/>../../src/main/res/layout/siteqty.xml:43:
40 android:text="Enter Qty" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productqty"/>
TextFields
Usability
Warning
Priority 5/10
Use Autofill
../../src/main/res/layout/channel.xml:49:
46 android:text="New Value" 47 /> 48 49 <EditText android:layout_height="wrap_content" 50 android:layout_width="match_parent" 51 android:layout_weight="1" 52 android:id="@+id/channelStatus"/>../../src/main/res/layout/login_activity.xml:50:
47 android:layout_width="wrap_content" 48 android:layout_height="wrap_content" 49 android:text="@string/login_activity_devname_label" /> 50 <EditText 51 android:id="@+id/devname_edit" 52 android:singleLine="true" 53 android:layout_width="fill_parent"../../src/main/res/layout/login_activity.xml:67:
64 android:layout_width="wrap_content" 65 android:layout_height="wrap_content" 66 android:text="@string/login_activity_username_label" /> 67 <EditText 68 android:id="@+id/username_edit" 69 android:singleLine="true" 70 android:layout_width="fill_parent"../../src/main/res/layout/login_activity.xml:93:
90 android:layout_width="wrap_content" 91 android:layout_height="wrap_content" 92 android:text="@string/login_activity_password_label" /> 93 <EditText 94 android:id="@+id/password_edit" 95 android:singleLine="true" 96 android:layout_width="fill_parent"../../src/main/res/layout/pin_activity.xml:49:
46 android:layout_width="wrap_content" 47 android:layout_height="wrap_content" 48 android:text="@string/pin_activity_pinnum_label" /> 49 <EditText 50 android:id="@+id/pin_edit" 51 android:singleLine="true" 52 android:layout_width="fill_parent"../../src/main/res/layout/sitecard.xml:21:
18 android:text="Card #" 19 /> 20 21 <EditText 22 android:id="@+id/carddpsid_id" 23 android:layout_width="match_parent" 24 android:layout_height="wrap_content"../../src/main/res/layout/siteprice.xml:43:
40 android:text="Enter Price" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productprice"/>../../src/main/res/layout/siteqty.xml:43:
40 android:text="Enter Qty" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productqty"/>
Autofill
Usability
Warning
Priority 3/10
Missing accessibility label
../../src/main/res/layout/channel.xml:49:
46 android:text="New Value" 47 /> 48 49 <EditText android:layout_height="wrap_content" 50 android:layout_width="match_parent" 51 android:layout_weight="1" 52 android:id="@+id/channelStatus"/>../../src/main/res/layout/login_activity.xml:50:
47 android:layout_width="wrap_content" 48 android:layout_height="wrap_content" 49 android:text="@string/login_activity_devname_label" /> 50 <EditText 51 android:id="@+id/devname_edit" 52 android:singleLine="true" 53 android:layout_width="fill_parent"../../src/main/res/layout/login_activity.xml:67:
64 android:layout_width="wrap_content" 65 android:layout_height="wrap_content" 66 android:text="@string/login_activity_username_label" /> 67 <EditText 68 android:id="@+id/username_edit" 69 android:singleLine="true" 70 android:layout_width="fill_parent"../../src/main/res/layout/login_activity.xml:93:
90 android:layout_width="wrap_content" 91 android:layout_height="wrap_content" 92 android:text="@string/login_activity_password_label" /> 93 <EditText 94 android:id="@+id/password_edit" 95 android:singleLine="true" 96 android:layout_width="fill_parent"../../src/main/res/layout/pin_activity.xml:49:
46 android:layout_width="wrap_content" 47 android:layout_height="wrap_content" 48 android:text="@string/pin_activity_pinnum_label" /> 49 <EditText 50 android:id="@+id/pin_edit" 51 android:singleLine="true" 52 android:layout_width="fill_parent"../../src/main/res/layout/sitecard.xml:21:
18 android:text="Card #" 19 /> 20 21 <EditText 22 android:id="@+id/carddpsid_id" 23 android:layout_width="match_parent" 24 android:layout_height="wrap_content"../../src/main/res/layout/siteprice.xml:43:
40 android:text="Enter Price" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productprice"/>../../src/main/res/layout/siteqty.xml:43:
40 android:text="Enter Qty" 41 /> 42 43 <EditText android:layout_height="wrap_content" 44 android:layout_width="match_parent" 45 android:layout_weight="1" 46 android:id="@+id/productqty"/>
LabelFor
Accessibility
Warning
Priority 2/10
TextView Internationalization
../../src/main/java/com/dwanta/android/dap/authenticator/AuthenticatorActivity.java:300:
297 if (TextUtils.isEmpty(mUsername) || TextUtils.isEmpty(mPassword) || TextUtils.isEmpty(mDevname)) { 298 setContentView(R.layout.login_activity); 299 mMessage = (TextView) findViewById(R.id.message); 300 mMessage.setText("please enter user/pass and device."); 301 Log.d(TAG, "message displayed"); 302 303 mUsernameEdit = (EditText) findViewById(R.id.username_edit);../../src/main/java/com/dwanta/android/dap/activities/DapActivity.java:352:
349 siteAdmin(mSiteDevice); 350 } 351 }); 352 sitebutton.setText("run store #" + mSiteDevice); 353 ll2.addView(sitebutton); 354 355 }../../src/main/java/com/dwanta/android/dap/activities/DapActivity.java:352:
349 siteAdmin(mSiteDevice); 350 } 351 }); 352 sitebutton.setText("run store #" + mSiteDevice); 353 ll2.addView(sitebutton); 354 355 }../../src/main/java/com/dwanta/android/dap/activities/DechoActivity.java:275:
272 if( jsonbuttons[i].getId() == i2 ) { 273 Log.d(TAG, "found button"); 274 String tag = jsonbuttons[i].getTag().toString(); 275 jsonbuttons[i].setText(tag + " UPDATED VALUE " + val); 276 } 277 } 278 }../../src/main/java/com/dwanta/android/dap/activities/DechoActivity.java:275:
272 if( jsonbuttons[i].getId() == i2 ) { 273 Log.d(TAG, "found button"); 274 String tag = jsonbuttons[i].getTag().toString(); 275 jsonbuttons[i].setText(tag + " UPDATED VALUE " + val); 276 } 277 } 278 }+ 38 More Occurrences...
SetTextI18n
Internationalization
Warning
Priority 6/10
Hardcoded text
../../src/main/res/layout/channel.xml:46:
43 android:layout_width="wrap_content" 44 android:layout_height="wrap_content" 45 android:layout_marginTop="5dip" 46 android:text="New Value" 47 /> 48 49 <EditText android:layout_height="wrap_content"../../src/main/res/layout/dapmain.xml:17:
14 android:layout_width="wrap_content" 15 android:layout_height="wrap_content" 16 android:layout_marginTop="5dip" 17 android:text="Connected Status: " 18 /> 19 20 <ToggleButton../../src/main/res/layout/dapmain.xml:24:
21 android:id="@+id/svctogglebutton" 22 android:layout_width="wrap_content" 23 android:layout_height="wrap_content" 24 android:textOn="On" 25 android:textOff="Off" 26 android:onClick="onSvcToggleClicked"/>../../src/main/res/layout/dapmain.xml:25:
22 android:layout_width="wrap_content" 23 android:layout_height="wrap_content" 24 android:textOn="On" 25 android:textOff="Off" 26 android:onClick="onSvcToggleClicked"/> 27 28 <Button android:id="@+id/delete_button"../../src/main/res/layout/dechomain.xml:15:
12 android:layout_height="wrap_content" 13 android:layout_alignParentLeft="true" 14 android:layout_alignParentTop="true" 15 android:text="Volume" 16 android:textAppearance="?android:attr/textAppearanceLarge" > 17 </TextView>+ 9 More Occurrences...
HardcodedText
Internationalization
Warning
Priority 5/10
Using left/right instead of start/end attributes
../../src/main/res/layout/dechomain.xml:13:
10 android:id="@+id/PRICEtextViewProgressID" 11 android:layout_width="wrap_content" 12 android:layout_height="wrap_content" 13 android:layout_alignParentLeft="true" 14 android:layout_alignParentTop="true" 15 android:text="Volume" 16 android:textAppearance="?android:attr/textAppearanceLarge" >../../src/main/res/layout/dechomain.xml:23:
20 android:id="@+id/PRICEseekBarID" 21 android:layout_width="match_parent" 22 android:layout_height="wrap_content" 23 android:layout_alignParentLeft="true" 24 android:layout_marginTop="26dp" 25 android:max="150" > 26 </SeekBar>../../src/main/res/layout/dechomain.xml:40:
37 android:id="@+id/PRICEinitialvaluetextID2" 38 android:layout_width="wrap_content" 39 android:layout_height="wrap_content" 40 android:layout_alignParentRight="true" 41 android:layout_below="@+id/PRICEseekBarID" 42 android:text="max" />../../src/main/res/layout-land/fragment_camera2_basic.xml:35:
32 android:layout_alignParentEnd="true" 33 android:layout_alignParentTop="true" 34 android:layout_below="@id/texture" 35 android:layout_toRightOf="@id/texture" 36 android:background="#4285f4" 37 android:orientation="horizontal">../../src/main/res/layout/fragment_camera2_basic.xml:48:
45 style="@android:style/Widget.Material.Light.Button.Borderless" 46 android:layout_width="wrap_content" 47 android:layout_height="wrap_content" 48 android:layout_gravity="center_vertical|right" 49 android:padding="20dp" 50 android:src="@drawable/ic_action_info" />+ 4 More Occurrences...
RtlHardcoded
Bidirectional Text
Internationalization
Warning
Priority 5/10
Included Additional Checks
This card lists all the extra checks run by lint, provided from libraries,
build configuration and extra flags. This is included to help you verify
whether a particular check is included in analysis when configuring builds.
(Note that the list does not include the hundreds of built-in checks into lint,
only additional ones.)
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
2. With a
3. With a //noinspection comment in the source code
4. With ignore flags specified in the
5. With a
6. With a
7. With the --ignore flag passed to lint.
To suppress a lint warning with an annotation, add a
To suppress a lint warning with a comment, add a
To suppress a lint warning in an XML file, add a
To suppress a lint warning in a
Here we specify a comma separated list of issue id's after the disable command. You can also use
To suppress lint warnings with a configuration XML file, create a file named
The format of the
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
For more information, see https://developer.android.com/studio/write/lint.html#config
1. With a
@SuppressLint annotation in the Java code2. With a
tools:ignore attribute in the XML file3. With a //noinspection comment in the source code
4. With ignore flags specified in the
build.gradle file, as explained below5. With a
lint.xml configuration file in the project6. With a
lint.xml configuration file passed to lint via the --config flag7. 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>
<!-- Ignore everything in the test source set -->
<issue id="all">
<ignore path="\*/test/\*" />
</issue>
<!-- 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" />
<ignore regexp="(foo|bar)\.java" />
</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/pathFor more information, see https://developer.android.com/studio/write/lint.html#config

