机器人:过程和进程名称 [英] android:process and process name

查看:91
本文介绍了机器人:过程和进程名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解安卓过程属性。 参考说:


  

如果名称分配给该属性
  始于冒号(':'),一个新的
  过程中,私有的应用,
  在需要时被创建。如果
  进程名以小写
  性格的一个全球进程
  名字被创建。一个全球性的过程可
  可以与其他应用程序共享,
  减少资源的使用。


请问一个过程,如果该名称不以一个冒号开始产生的?如果它开始以一个大写字母?如果我混用两种规则会发生什么?

我需要从同一个进程中运行两个包两部分组成,以节省资源(并避免两个正在运行的应用中的应用程序管理器中列出)。应该是什么我的过程叫什么名字?我需要一个全球性的过程吗?

编辑:

我试图用一个简单的小写字母的域名(第一包的名字),它似乎它的工作像我想要的。不过我想我不明白的规则。


解决方案

  

如果我混用两种规则会发生什么?


这是不可能的。冒号不是一个大写字母。


  

我需要从同一个进程中运行两个包两部分组成,以节省资源(并避免两个正在运行的应用中的应用程序管理器中列出)。


这真的不是一个好主意。把它们放在同一个包,或者让他们独立运行。

您不仅将有更动安卓过程,但你也有更动的android:sharedUserId 。这些都不是为了普通SDK的开发者,特别是 Android的使用:sharedUserId 。事实上,如果你已经分布式应用程序,你的不能的使用的android:sharedUserId 除非你愿意打破现有的所有用户应用程序,因为您将不再能够访问你的原始数据,因为它会通过一些其他的用户帐户拥有。

此外,除非你有相反的证据,我不会认为这会莫名其妙地避免两个正在运行的应用在应用管理器中列出。

现在,我所有的效率,因此创造了笑容(例如,被误导的建议,让定制进程中运行远程服务)是一个坏主意额外的过程。如果你的设备制造商或20+ Android开发什么的一个公司工作,并且要与周围的这个烂摊子,你将需要找地方它是在AOSP使用,反向工程的信息你追求的,因为这个东西是认真记录下。而即使在那里,我没有看到它的多个包间使用,除了 android.process.acore com.android.phone ,这是严重的低级进程并不会是典型的非固件应用程序。

所以,我真的建议你独自离开这些东西。

I'm trying to understand the android:process attribute. Ref says:

If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed. If the process name begins with a lowercase character, a global process of that name is created. A global process can be shared with other applications, reducing resource usage.

Will a process be created if the name doesn't begin with a colon? What if it begins with a capital letter? And what happens if I mix the two rules?

I need to have two components from two packages run in the same process to save resources (and to avoid having two "running apps" listed in the apps manager). What should be my process name? Do I need a global process?

EDIT:

I tried with a simple lower case name (first package's name) and it seems it's working like I want. Still I think I don't get the rules.

解决方案

And what happens if I mix the two rules?

That's not possible. A colon is not a capital letter.

I need to have two components from two packages run in the same process to save resources (and to avoid having two "running apps" listed in the apps manager).

That's really not a good idea. Put them in the same package, or have them run independently.

Not only would you have to mess around with android:process, but you also have to mess around with android:sharedUserId. Neither of these are meant to be used by ordinary SDK developers, particularly android:sharedUserId. In fact, if you have already distributed your application, you can't use android:sharedUserId unless you're willing to break all your existing users' apps, since you will no longer be able to access your original data, since it'll be owned by some other user account.

Furthermore, unless you have evidence to the contrary, I would not assume that this will somehow "avoid having two 'running apps' listed in the apps manager".

Now, I am all for efficiency, and so creating extra processes for grins (e.g., misguided advice to make "remote services" run in custom processes) is a bad idea. And if you work for a device manufacturer or a firm with 20+ Android developers or something, and you want to mess around with this, you're going to need to find places where it is used in the AOSP and reverse-engineer the information you seek, since this stuff is seriously under-documented. And even there, I am not seeing it used between multiple packages, except for android.process.acore and com.android.phone, which are seriously low-level processes and are not going to be typical of non-firmware apps.

Hence, I really recommend that you leave these things alone.

这篇关于机器人:过程和进程名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆