AndroidManifest.xml檔案詳解(instrumentation)

來源:互聯網
上載者:User

文法(SYNTAX):

<instrumentationandroid:functionalTest=["true" | "false"]
                 android:handleProfiling=["true" | "false"]
                 android:icon="drawable resource"
                 android:label="string resource"
                 android:name="string"
                 android:targetPackage="string"/>

被包含於(CONTAINED IN):

<manifest>

說明(DESCRIPTION):

這個元素宣告了一個Instrumentation類,這個類能夠監視應用程式跟系統的互動。Instrumentation對象會在應用的其他所有組件被執行個體化之前執行個體化。

屬性(ATTRIBUTES):

android:functionalTest

這個屬性用於指定Instrumentation類是否應該作為一個功能性的測試來運行,如果設定為true,這要運行,否則不應該運行。預設值是false。

android:handleProfiling

這個屬性用於指定Instrumentation對象是否會開啟和關閉分析功能。如果設定為true,那麼由Instrumentation對象來決定分析功能的啟動和終止時機,如果設定為false,則分析功能會持續到Instrumentation對象整個運行周期。如果設定為true,會使Instrumentation對象針對一組特定的操作來進行分析。預設值是false。

android:icon

這個屬性用於給Instrumentation類設定一個表徵圖。它必須要應用一個可繪製的資源。

android:label

這個屬性用於給Instrumentation類設定一個使用者可讀的標籤。這個標籤可用原生字串,也可以引用一個字串資源。

android:name

這個屬性用於設定Instrumentation子類的名稱。應該是完整的Java類名(如:com.example.project.StringInstrumentation)。但是,也可以用簡寫方式(如:.StringInstrumentation),它的包名會使用<manifest>元素的package屬性中指定的包名。

它沒有預設值,必須被指定。

android:targetPackage

這個屬性用於指定Instrumenttation對象所監視的應用程式。由包名所標識的應用程式會跟清單的<manifest>元素的package屬性值相關聯。

被引入版本(INTRODUCED IN):

API Level 1

 


摘自 FireOfStar的專欄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.