日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

代码提示级别设置 inspection

發布時間:2025/3/18 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 代码提示级别设置 inspection 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

配置文件

profile [?pro?fa?l] n.側面; 外形,輪廓; 人物簡介; vt.描…的輪廓; 給…畫側面圖; inspection [?n?sp?k??n] n.檢驗; 檢查; 視察; 檢閱; x1091profile [?pro?fa?l] n.側面; 外形,輪廓; 人物簡介; vt.描…的輪廓; 給…畫側面圖; 2inspection [?n?sp?k??n] n.檢驗; 檢查; 視察; 檢閱; AS相關的配置文件基本都放在\Users\Administrator\.AndroidStudio3.0\config】目錄下代碼提示級別相關的配置文件放在【\config\inspection】目錄下:默認只有一個Default.xml配置文件,里面只配置了一個name:<inspections profile_name="Default" version="1.0"><option name="myName" value="Default" /> </inspections>1<inspections profile_name="Default" version="1.0">2 ?<option name="myName" value="Default" />3</inspections>我新建了一個profile,并更改了一些配置,文件內容變為:<inspections profile_name="bqt" version="1.0"><option name="myName" value="bqt" /><inspection_tool class="AndroidLintAddJavascriptInterface" enabled="true" level="INFO" enabled_by_default="true" /><inspection_tool class="FieldCanBeLocal" enabled="true" level="INFO" enabled_by_default="true" />... </inspections>71<inspections profile_name="bqt" version="1.0">2 ?<option name="myName" value="bqt" />3 ?<inspection_tool class="AndroidLintAddJavascriptInterface" enabled="true" level="INFO" enabled_by_default="true" />4 ?<inspection_tool class="FieldCanBeLocal" enabled="true" level="INFO" enabled_by_default="true" />5 ...6</inspections>里面詳細記錄了你所有的修改點,所以,其實你只需保存這個配置文件即可。

一、修改 JAVA 設置

Declaration Redundancy?聲明冗余

Declaration access can be weaker

Class structure

field can be local

二、修改?Android --> Lint 設置

Internationalization?國際化

Hardcoded硬編碼 text?
Overlapping重疊items?in RelativeLayout,比如下圖的TV如果只有toRightOf沒有toLeftOf,就可能出現控件重疊情況:
TextView Internationalization

Bidirectional?Text?雙向文字

Padding and margin symmetry?對稱
Right-to-left text compatibility issues?從右到左文字兼容性問題
Using left/right instead of start/end attributes
Using RTL attributes without enabling RTL support?

Accessibility?無障礙

Image without contentDescription
Missing labelFor attribute

Security 安全

addJavascriptInterface CalledAllowBackup/FullBackupContent Problems?允許備份/完整的備份內容
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.1The 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 2By 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.

Usability?可用性

Missing support for Firebase App Indexing
Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search. 11Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search. Text size is too small

附件列表

?

總結

以上是生活随笔為你收集整理的代码提示级别设置 inspection的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。