set Android IP address from my own android application
I need to 开发者_开发问答set IP adress on Android phone from my own application, any idea?
you can set a ip for wifi but for mobile network
(Menu button) setting->wireless and network -> wifi setting ->(menu button again) -> advanced.
(Menu button) setting->wireless and network -> Mobile network -> Access Point Name -> and you can check if you can set a ip.
and btw, i think you can do (via software) with root access, otherwise it is not allowed.
If you have busybox, installed, try opening a shell within your code and typing the following: busybox ifconfig eth0 IP_ADDR_YOU_WANT
If you are talking about the WiFi adapters IP address then no it is not possible and you certainly can't set a public IP address yourself since your providers network is not under your control and doesn't work as you might think it does.
You can only redirect the user to the wireless settings screen so he can set it himself.
精彩评论