android-management-apiandroid-managed-profile

Configuring WIFI profiles using AMAPI


I am trying to add wifi profile to my managed device using android management API and couldn't firgure out how but i looked through the internet.

Found one asking it possible to configure using opennetworkconfiguration policy but it did not work for me. And i also doubt if it is possible. So i am here reaching out for help to configure wifi in managed device using android management API.

Thanks in advance!


Solution

  • Yes, you can use the policy to configure your Wi-Fi network using openNetworkConfiguration. The Android Management API uses Open Network Configuration, a standard JSON-based format that was originally developed as part of the Chromium project. You may refer to the specification for complete details on Open Network Configuration.

    To include an Open Network Configuration in a policy, you need to set the ONC field on a Policy resource.

    Example Policy:

      "openNetworkConfiguration": {
          "Type": "UnencryptedConfiguration",
          "NetworkConfigurations": [
            {
              "Name": "Testxxxx",
              "GUID": "Testxxxx",
              "Type": "WiFi",
              "WiFi": {
                "SSID": "Testxxxx",
                "Security": "WPA-PSK",
                "Passphrase":"xxxxxxxxxxxxxx",
                "AutoConnect": true
              }
            }
          ]
       }
    

    Refer to the Supported features and examples for more details.

    For fully managed devices, you can optionally prevent a user from manually configuring Wi-Fi settings on their device by setting wifiConfigDisabled to true in the Policy resource.

    Note: Disabling the ability to configure Wi-Fi settings while failing to declare any Wi-Fi networks in openNetworkConfiguration will disable Wi-Fi on the device and prevent it from accessing any Wi-Fi networks.