开发者

How does Android test network connectivity (system level)

This is not about Java level code. What I'm looking for is how Android test the connectivities in low level.

for example, when we call getActiveNetwork(), which low level (maybe C+开发者_如何学C+ or even C) code is being called, and how does it work? does it ping to an external address (which is highly unlikely, just guessing around)? please try to be specific.

Thanks,


You need to research TCP/IP and OSI Models for networking.

In these models it is the lowest level in the network stack that is responsible for maintaining the data-link and I believe this possibly outside of the scope of the Operating system i.e. it is all done at hardware level.

I would assume that Android OS merely requests a network interface to 'connect' or 'disconnect' and probably provides hooks for the lower Data Link layer to call should network status change.

You really have to consider what you mean by 'network connectivity'. Do you mean being able to access websites or merely a network interface has a data link... they are not necessarily the same thing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜