Android工具:Lint的使用,android工具lint

來源:互聯網
上載者:User

Android工具:Lint的使用,android工具lint

1.在cmd中執行:lint  --show  AllowBackup // 顯示lint中關於AllowBackup這個話題(issue)的解釋,執行結果如下:

AllowBackup-----------Summary: Ensure that allowBackup is explicitly set in the application'smanifestPriority: 3 / 10Severity: WarningCategory: SecurityThe allowBackup attribute determines if an application's data can be baand restored. It is documented athttp://developer.android.com/reference/android/R.attr.html#allowBackupBy 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 baand adb restore.This may have security consequences for an application. adb backup allousers who have enabled USB debugging to copy application data off of thdevice. Once backed up, all application data can be read by the user. arestore allows creation of application data from a source specified byuser. Following a restore, applications should not assume that the datapermissions, and directory permissions were created by the applicationitself.Setting allowBackup="false" opts an application out of both backup andrestore.To fix this warning, decide whether your application should support bacand explicitly set android:allowBackup=(true|false)"More information:http://developer.android.com/reference/android/R.attr.html#allowBackup</span>
2.在cmd中執行:lint  --show // 顯示lint中所有話題(issue)的解釋;

3.在cmd中執行:lint  --help // 顯示lint的使用協助;


小結:本人在瞭解android:allowBackup屬性含義時,順帶發現了Lint的一些用法。以上為拋磚引玉,發現更多金礦就靠你自己啦!


android開發:@SuppressLint( NewApi ) 這個是什

這個是android帶的lint工具提示的,lint官方的說法是 Improving Your Code with lint,應該是協助提升代碼的 ,如果不想用的話,可以右鍵點工程,然後在android tools 中,選擇 clear lint marker 就沒有這個錯誤了
 
lint工具是什?

PC-Lint是C/C++軟體代碼靜態分析工具,你可以把它看作是一種更加嚴格的編譯器。它不僅可以檢查出一般的語法錯誤,還可以檢查出那些雖然符合文法要求但不易發現的潛在錯誤。
……………………
就是一個錯誤修正工具

下面是更為詳細的資訊
…………………………
LINT工具是一種軟體品質保證工具,許多國外的大型專業軟體公司,如微軟公司,都
把它作為程式檢查工具,在程式合入正試版本或交付測試之前一定要保證通過了LINT檢查
,他們要求軟體工程師在使用LINT時要開啟所有的編譯開關,如果一定要關閉某些開關,
那麼要給出關閉這些開關的正當理由。

可想而知,如果從我們編碼後第一次編譯器時就使用LINT來檢查程式,並且保證消
除所有的LINT警示,我們就不會遇到象今天這麼多的警示資訊。即使在今天,我們如果能
抽出一定的精力來消除程式中的LINT警示,以後再維持這種無警示狀態就是很容易的了。
我們程式品質的提高也是不言而喻的。

PC-LINT是GIMPEL SOFTWARE公司的產品,其中的內容是非常廣泛的,光是選項就有30
0多個,涉及到程式編譯及文法使用中的方方面面。本篇培訓材料旨在引導讀者入門,學會
PC-LINT的基本使用方法,起拋磚引玉的作用,能讓讀者從這裡起步繼續去研究如何嫻熟地
使用PC-LINT的各種選項,能讓它充分為我們的開發工作服務。

1.概述
如果要給LINT工具下一個形象點的定義,那就是:一種更加嚴格的編譯器。它不僅可
以象普通編譯器那樣檢查出一般的語法錯誤,還可以檢查出那些雖然完全合乎文法要求,
但很可能是潛在的、不易發現的錯誤。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.