怎样设置,获取profile 里变量的值

怎样设置,获取profile 里变量的值,第1张

如果是SHELL程序的话,

直接$VAR的格式就可以取它的值了.

比如你的profile里有export JDK=1.6

那你取的时候就 echo $JDK 就可以了.

计算机中常用的 Profile 该如何理解?

我认为 Profile 即可作名词又可作动词。

1。profile作为名词时常用的意思:

profile 本身意思是剖面, 侧面, 外形, 轮廓。但现在常用这个字时,它的含义更进一层

a.简介,档案

my profile 表示我的个人信息。

For example, if you are writing an eCommerce website, "retrieve user's profile" means 查看用户的档案资料。get user's name, age, shoping history, interests, etc. So profile can be understood as "outline of a person's characteristics".

company profile: 公司概况,公司简介

个人简历用resume, 个人资料用profile

b.profile 也作图表的意思:

A formal summary or analysis of data, often in the form of a graph or table, representing distinctive features or characteristics(引自金山词霸),一概图:对数据的正式概括或分析,经常用曲线图或图表的形式,其表现出事物的明显的特点或特色。

例如:side effect profile可译为:"不良反应分布图"或者"不良反应范围"

2.Profile 作为动词时

when profile is used as a verb, it means create the outline of something, or summarize characterstics of it. "Profile a software program" means finding out the characterstics of the program, like how much memory it takes, how much time spent in each method, how often a method is called, etc.

android应用程序详细信息可以通过PackageManger管理类来获得,PackageManger管理所有程序包的信息,包括包名、label、icon、占用大小、是系统程序还是第三方程序等信息。

PackageManager pm = this.getPackageManager()// 获得PackageManager对象

Intent mainIntent = new Intent(Intent.ACTION_MAIN, null)

mainIntent.addCategory(Intent.CATEGORY_LAUNCHER)

// 通过查询,获得所有ResolveInfo对象.

List<ResolveInfo>resolveInfos = pm

.queryIntentActivities(mainIntent, PackageManager.MATCH_DEFAULT_ONLY)

如果你希望获取某单个应用程序信息,只需要通过pm对象获取当中的包名,再与你想要获得应用程序的包名比较一下,再获取相应的属性就可经了。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12077893.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存