当前位置:首页 > 英文周记 > 正文内容

instrumentation「instrumentation和instrument的区别」

更新时间:2026-07-18 11:30:06 周记网3年前 (2023-03-01)英文周记300

Instrumentation的理解

一般的应用不太会用到instrumentation,所以网上对其介绍也比较少。

但因其强大的跟踪application及activity生命周期的功能,用于android 应用测试框架中,被做为基类使用。

instrumentation的官方文档:

instrumentation「instrumentation和instrument的区别」

查看其提供的方法,比如:callActivityOnCreate,callApplicationOnCreate,newActivity,callActivityOnNewIntent 等基本上在application和activity的所有生命周期调用中,都会先调用instrumentation的相应方法。并且针对应用内的所有activity都生效。为程序员提供了一个强大的能力,有更多的可能性进入android app框架执行流程。

对于每一个android app来说,它的总入口都是ActivityThread::main. 每一个应用的进程都有一个ActivityThread对象,而每一个ActivityThread对象都有一个Instrumentation mInstrumentation;成员变量。mInstrumentation的初始化在ActivityThread::handleBindApplication函数中:

自定义的instrumentation只能通过调用Context.startInstrementation或者命令行am instrument启动,这个过程会将目标进程杀死再重启(声明instrumention的应用与目标应用签名必需一致)。如果应用不是通过上述方式启动而是正常情况下(通过launcher或者startActivity)启动,会默认new 一个系统的Instrumentation.

如果某应用要自定义instrumentation且用于跟踪本应用内的application及activity生命周期,通过继承实现Instrumentation并反射修改ActivityThread.mInstrumentation的方法可以做到。以下是具体做法:

1、自定义Instrumentation

2、反射调用修改ActivityThread.mInstrumentation

至此即可通过MyInstrumentation来跟踪应用内application及activity的生命周期。

Instrumental是什么意思

Instrumental的意思:

adj. 有帮助的,起作用的;用乐器演奏的;与乐器有关的;与(事物)的工具效用有关的;与仪器或测量器具有关的;(语法)工具格的

n. 器乐曲(通常指非古典音乐);工具格名词,工具格

短语

Instrumental Pieces 器乐演奏

instrumental case 工具格

Instrumental Rock 器乐摇滚 ; 乐器摇滚 ; 演奏摇滚 ; 摇滚演奏曲

同根词

词根: instrument

adj.

instrumentalist 工具主义的

n.

instrument 仪器;工具;乐器;手段;器械

instrumentation 使用仪器;乐器法;仪表化

instrumentality 手段;工具;机构

instrumentalist 工具主义者;乐器演奏家

instrumentali** [劳经] 工具主义

apparatus与instrumentation的区别

apparatus:n.仪器,器械;机器;机构,机关;器官

既可指某种具体的由许多不同零件构成的复杂的仪器、装置或器械,又可指它们的总称。

instrumentation:n.使用仪器,装设仪器;乐器法;乐曲研究;手段

通常指能使人们完成某一精确动作或测量的一种小型仪器,尤指电工仪表、测量装置,航海或航空用的控制装置。

instrument和instrumentation的区别是什么?谢谢

instrumentationn.(装设)仪器; 仪表化, 仪表使用(法); 器械操作; 检测仪表; 测试设备用乐器演奏谱曲, 作曲法乐器研究; 仪器制造学手段, 方法实行[现]

instrumentvt.用仪器装备编(乐曲); 改编为管弦乐向...提交法律文件adj.【航空】用仪器导航的instrument flying用仪器导航的飞行instrument landing仪表(指导)着陆

n.工具, 手段, 方法, 傀儡仪器; 器械, 仪表, 装置, 设备证书[券]; 契约, 文件乐器

什么是Instrumentation

什么是Instrumentation?

一般在开发Android程序的时候,需要写一个manifest文件,其结构是:

application android:icon="@drawable/icon" android:label="@string/app_name"

activity android:name=".TestApp" android:label="@string/app_name"

……

/activity

/application

 

 这样,在启动程序的时候就会先启动一个Application,然后在此Application运行过程中根据情况加载相应的Activity,而

Activity是需要一个界面的。但是Instrumentation并不是这样的。你可以将Instrumentation理解为一种没有图形界面

的,具有启动能力的,用于监控其他类(用Target

Package声明)的工具类。任何想成为Instrumentation的类必须继承android.app.Instrumentation。下面是

这个类的解释:

“Base class for implementing application instrumentation

code. When running with instrumentation turned on, this class will be

instantiated for you before any of the application code, allowing you to

monitor all of the interaction the system has with the application. An

Instrumentation implementation is described to the system through an

AndroidManifest.xml's tag.“

仪器英语怎么说

问题一:“仪器仪表”用英文怎么表达? Instrument measuring appliance

问题二:“仪器仪表”用英文怎么表达 “仪器仪表”

Instrumentation

问题三:检测仪器用英文怎么说 检测仪器

[词典] [医] detecting instrument;

[例句]从测量原理、特点和资料解释方法等方面对AMK-2000M固井质量检测仪器进行探讨和分析。

Studied and *** yzed are measuring principle and log data interpretation method of AMK-2000M detector.

问题四:仪器室 用英文怎么说 equipment room

问题五:仪器架用英语怎么说 仪器架

[词典] [医] instrument stan;

[例句]除了线性安装外,其余仪器安装在仪器架上,且便于操作。

Suitably mount all instruments, other than line-mounted, to the skid on instrument stands, and make easily accessible.

问题六:仪器科学与电气工程学院、测控技术与仪器专业用英文怎样说? 吉林大学仪器科学与电气工程院 College of Instrumentation Electrical Engineering,Jilin University 测控技术与仪器 Measurement and Control Technology and Instrumentation Program

问题七:实验仪器 用英文怎么写 实验仪器

Experimental instrument

标签: instrumentation

“instrumentation「instrumentation和instrument的区别」” 的相关文章

instrumentation「instrumentation期刊」

instrumentation「instrumentation期刊」

Instrumentation的理解 一般的应用不太会用到instrumentation,所以网上对其介绍也比较少。 但因其强大的跟踪application及activity生命周期的功能,用于and...

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。