How to execute the ifconfig command in the Android program to modify the Android IP address,

Source: Internet
Author: User

1 、引入: import android.provider.Settings; import android.content.ContentResolver; ps:在Setting.System中有以下标志 WIFI_USE_STATIC_IP WIFI_STATIC_IP WIFI_STATIC_NETMASK WIFI_STATIC_GATEWAY WIFI_STATIC_DNS1 and WIFI_STATIC_DNS2 2 、在AndroidManifest中加入<uses-permission  android:name= "android.permission.WRITE_SETTINGS" /> 3 、在Activity中可以这样用: final ContentResolver mContentResolver = getContentResolver(); Settings.System.putInt( mContentResolver, Settings.System.WIFI_USE_STATIC_IP,  1 ); Settings.System.putString( mContentResolver, Settings.System.WIFI_STATIC_IP,  "你的ip地址" );how to execute the ifconfig command in the Android program to modify the Android IP address,

How do I execute the ifconfig command in an Android program to modify the Android IP address,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.