Android的以太网配置IP使用DHCP [英] Android ethernet configure IP using dhcp

查看:2537
本文介绍了Android的以太网配置IP使用DHCP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个以太网接口,一个机器人盒。有在Android SDK中没有Java类配置以太网。作为最后的手段,我使用shell命令来配置以太网。难道任何机构请指导我我使用的shell命令来配置以太网?示例命令将高度AP preciated。

I have an android box with ethernet interface. There are no Java classes in android SDK to configure ethernet. As a last resort I am using shell commands to configure ethernet. Could any body please guide me which shell command do I use to configure ethernet? Sample commands will be highly appreciated.

推荐答案

Android的得到的ifconfig,就像Linux操作系统。不幸的是,仅仅改变了接口配置,并没有,比如,告诉应用程序接口已经到来了,所以他们可能不知道有任何网络连接,因此它可能没有多大帮助。我怕我忍不住在那里。

Android's got ifconfig, just like Linux. Unfortunately that just changes the interface configuration and doesn't, e.g., tell applications that the interface has come up, so they may not be aware that there's any internet access, so it may not help much. I'm afraid I can't help there.

有关参考,你用ifconfig这样的:

For reference, you use ifconfig like this:

ifconfig <interface> up <ip address> mask <netmask> gw <gateway>

&LT;接口&GT; 将可能是的eth0 ,和其他领域都相应的IP地址。你可以看到哪些接口可用通过catting 的/ proc /净的/ dev

<interface> will probably be eth0, and the other fields are the appropriate IP addresses. You can see what interfaces are available by catting /proc/net/dev.

说实话,你不应该的需要的做到这一点--- Android的(或至少是现代的机器人,你没有说你正在使用的版本)的以太网适当的支持>无线和网络 - 通过设置配置。是否有任何理由,这是不是为你工作?

To be honest, you shouldn't need to do this --- Android (or at least modern Android, you didn't say which version you're using) has proper support for ethernet configuration via Settings -> Wireless and Networks. Is there any reason why this isn't working for you?

这篇关于Android的以太网配置IP使用DHCP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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