Can Android applications examine OS wide context, for example network related?
Can Android applications see OS wide context in terms of network? For example,
- what applications are using the network
- what IP addresses is the OS connected 开发者_高级运维to
- etc.
I'm asking because I know each application runs in it's own Dalvik virtual machine.
No, generally you cannot see the state of any other applications, nor can you generally get low-level information such as the IP address from the Android framework classes.
However, you could try using the usual java.net
classes to see whether you get anything back. For example NetworkInterface.getNetworkInterfaces()
should hopefully still give you the expected information as it would on a regular VM.
Alternatively, outwith the Android API you could access networking information as you would on any other Linux system.
精彩评论