• android开启指定名称的wifi热点

    private static final String SETUP_WIFIAP_METHOD = "setWifiApEnabled"; Context context = null; WifiManager wifiManager = null; static HPaConnector hPaConnector = null; public static HPaConnector getInstance(Context context) { if (hPaConnector == null) { hPaConnector = new HPaConnector(); hPaConnector.context = context.getApplicationContext(); hPaConnector.wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); } return hPaConnector; } public void setupWifiAp(String name, String password) throws Exception { if (name == null || "".equals(name)) { throw new Exception("the name of the wifiap is cannot be null"); } Method setupMethod = wifiManager.getClass().getMethod(SETUP_WIFIAP_METHOD, WifiConfiguration.class, boolean.class); WifiConfiguration netConfig = new WifiConfiguration(); // 设置wifi热点名称 netConfig.SSID = name; netConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN); netConfig.allowedProtocols.set(WifiConfiguration.Protocol.RSN); netConfig.allowedProtocols.set(WifiConfiguration.Protocol.WPA); netConfig.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP); netConfig.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP); netConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP); netConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP); if (password != null) { if (password.length() < 8) { throw new Exception("the length of wifi password must be 8 or longer"); } // 设置wifi热点密码 netConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK); netConfig.preSharedKey = password; } setupMethod.invoke(wifiManager, netConfig, true); } public void setupWifiAp(String name) { setupWifiAp(name); }

    1
    147
    1.41MB
    2015-08-20
    5
  • 蓝牙调试助手

    蓝牙调试助手 作用:扫描和连接蓝牙设备,接收发送蓝牙消息、建立蓝牙通信连接、打印蓝牙消息

    0
    44
    121KB
    2015-08-20
    15
  • 小米便签源码

    仿小米便签的实现源码,具体功能可以查看自己手机里的便签

    0
    45
    1.07MB
    2014-07-13
    0
  • android中文天气预报

    主要是在android系统下实现的中文天气预报的一个小应用。写的不好之处,多多指教

    0
    31
    65KB
    2014-07-13
    0
  • android拍照上传代码

    主要是关于android 拍照上传图片的一个例子。比较实用,用到的应该比较多

    5
    32
    18KB
    2014-07-13
    5
  • 可以横向拖动的tabHost

    可以横向拖动的TabHost,下载后有问题可以直接评论下问题。有时间必来解决

    0
    57
    36KB
    2014-07-13
    9
  • 安卓换肤代码

    通过下载皮肤apk,可以直接运用,进行换肤.该种方法为目前主流的换肤技术。因为这里没有做apk下载。所以必选保证两个apk都运行,存在。再去点击skin_2项目的换肤才有效果。

    0
    51
    3.17MB
    2014-05-13
    10
  • 阅读者勋章

    授予在CSDN APP累计阅读博文达到3天的你,是你的坚持与努力,使你超越了昨天的自己。
关注 私信
上传资源赚积分or赚钱