WPA2-PSK wifi AP。如何在android中以编程方式创建? [英] WPA2-PSK wifi AP. How to create in android programmatically?

查看:89
本文介绍了WPA2-PSK wifi AP。如何在android中以编程方式创建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天!请帮助我理解为什么 WPA2-PSK 未创建Wifi接入点。我有什么:



我的尝试:



< b> AndroidManifest.xml:



Good day! Please, help me understand why WPA2-PSK Wifi Access Point is not created. What do I have:

What I have tried:

AndroidManifest.xml:

<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />





build .gradle:





build.gradle:

compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.java.name"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }





我尝试过不同类型的代码创建wifi AP:



如何从android创建基于WPA2_PSK的热点应用程序 - 解决方案位 [ ^ ]



[ ^ ]





应用程序在小米Redmi Note4上推出,Android版本 - 7.0



不幸的是没有一个解决方案帮助了我,我仍然得到了Wifi AP已创建,但它是开放的,没有密码。请问,有人知道这是什么问题吗?谢谢。



I have tried different types of codes creating wifi AP:

How to create a WPA2_PSK based hotspot from android app – Solutions Bits[^]

Creating WPA2 PSK Access Point in Android Programmatically - Stack Overflow[^]


Application is launched on Xiaomi Redmi Note4, Android version - 7.0

Unfortunately none of solutions helped me, I`m still getting Wifi AP created but it is open and without password. Please, does anybody know what is the problem? Thank you.

推荐答案

hello there ! I exactly had the same problem as yours , whenever i run my app , the password is always empty in my honor 6x android 7.0. I dont know if you are doing the same mistake but in my case i set Keymanagement to WPA_PSK , where it should be set to '4'.(WPA2_PSK). After that my app was fine. But the answers were already in the links you shared


这篇关于WPA2-PSK wifi AP。如何在android中以编程方式创建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆