安卓源代码: https://android.googlesource.com/?format=HTML
使用binder,应用可以跟系统或者其他应用通讯 (it is used in almost everything that happens across processes in the core platform)
当应用要启动一个服务时,that process is going through the Binder to the Service Manager, look it up, and sends a reference to the App, then the App can go and requests remote calls from that object.
如一个应用想要实例化Windows Service, 使用如下语句:
WindowManager mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE)
这个应用就可以调用WindowManager的方法:
-
mWindowManager.addView(mDecor, l);
-
mWindowManager.removeView(mDecor);
- mWindowManager.updateViewLayout(mDecor, params);
时间: 2024-12-12 23:42:42