【问题标题】:How to create an access point如何创建接入点
【发布时间】:2011-04-04 17:14:59
【问题描述】:

我想创建一个可以创建接入点的应用程序。查看 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 一样?我能以某种方式访问​​此方法吗?

【问题讨论】:

  • 尝试使用反射来处理,这里有一个例子:stackoverflow.com/questions/7048922/…>!

标签: android wifi access-point


【解决方案1】:

你可以使用accesspoint:

WifiApControl apControl = WifiApControl.getInstance(context);

apControl.enable();

【讨论】:

    猜你喜欢
    • 2013-02-01
    • 2011-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-04
    • 1970-01-01
    相关资源
    最近更新 更多