Please explain to me what are the ways to change the ip on Android programmatically ( create the program yourself and use it as you like), tell any methods the main thing is that they are software , preferably with an indication of the Android versions on which these methods are supported. As well as ways to implement these methods .

    1 answer 1

    Firstly, it should be said that in the 3G / 4G network it will not be possible to change the ip, which is issued to you by the provider. You can only set a static ip in the local Wi-Fi.

    Prior to API 17, Settings.System used:

     final ContentResolver cr = getContentResolver(); Settings.System.putInt(cr, Settings.System.WIFI_USE_STATIC_IP, 1); Settings.System.putString(cr, Settings.System.WIFI_STATIC_IP, "you.re.ip.addr"); 

    You need permission android.permission.WRITE_SETTINGS .

    But now it is deprecated, you need to use WifiManager .

    • Please explain how to use WifiManager - Artik Kozorun
    • @ArtikKozorun I can’t write everything for you) - Suvitruf
    • Okay, but how can this be done through VPN, is it possible to create a VPN profile programmatically, that is, just as a user creates it, only when it is programmed (strangely, he said, but I think it is clear) - Artik Kozorun