开发者

Is Android IPC plumbing exposed in any official and/or supported way?

开发者 https://www.devze.com 2022-12-30 05:35 出处:网络
I\'m interested in knowing how much the IPC mechanisms are meant to be exposed to the outside world. That is, if I wanted to impersonate a dalvik VM instance without having my app actually written in

I'm interested in knowing how much the IPC mechanisms are meant to be exposed to the outside world. That is, if I wanted to impersonate a dalvik VM instance without having my app actually written in Java, am I allowed to do so, or will the protocol change the next time I look away from the screen? If it's allowed, what are the stability guarantees or lack thereof? Is there anything like documentation, or am I supposed just to read the fine sources on android.git.kernel.org?

The purpose of it开发者_JS百科 all would be to write apps in !Java languages while retaining the ability to construct GUIs. I don't care or mind if the code is technically inside a dalvik process as a JNI callout, what I'm interested in is "if I'm really good at pretending I'm Java over the wire, can I do everything actual Java code can? Or is there something that's only available as Java bytecode and nothing else?"


The purpose of it all would be to write apps in !Java languages while retaining the ability to construct GUIs.

Only Dalvik VM bytecode is capable of constructing GUIs. That bytecode does not necessarily have to be Java -- it could be from Scala, for example. But it does have to be bytecode run by the VM.

The Android IPC mechanism, based on OpenBinder, is used for coarse-grained stuff, not GUIs. FWIW, JNI, via the NDK, does not use IPC per se -- JNI represents library calls, not inter-process calls.

So, when you ask:

if I'm really good at pretending I'm Java over the wire, can I do everything actual Java code can?

Yes, but only for those things that are done "over the wire". The vast majority of an Android application is not processed "over the wire", for performance reasons.

0

精彩评论

暂无评论...
验证码 换一张
取 消