我想创建一个可以创建访问点的应用程序。浏览android文档,我看到wifimanager类[1]:

/**
     * Start AccessPoint mode with the specified
     * configuration. If the radio is already running in
     * AP mode, update the new configuration
     * Note that starting in access point mode disables station
     * mode operation
     * @param wifiConfig SSID, security and channel details as
     *        part of WifiConfiguration
     * @return {@code true} if the operation succeeds, {@code false} otherwise
     *
     * @hide Dont open up yet
     */
    public boolean setWifiApEnabled(WifiConfiguration wifiConfig, boolean enabled) {
        try {
            return mService.setWifiApEnabled(wifiConfig, enabled);
        } catch (RemoteException e) {
            return false;
        }
    }

但由于某种原因它是隐藏的。有没有办法和wifimanager一样?我可以用这种方法吗?

最佳答案

您可以使用accesspoint

WifiApControl apControl = WifiApControl.getInstance(context);

apControl.enable();

关于android - 如何创建接入点,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5541953/

10-09 21:07