My app configures and activates an access point:
// Expose the required method
WifiManager wifimanager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
Method setWifiApEnabled = wifiManager.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, boolean.class);
// Set up my configuration
WifiConfiguration myConfig = new WifiConfiguration();
myConfig.SSID = "markhotspot";
myConfig.allowedProtocols = WifiConfiguration.Protocol.RSN;
myConfig.preSharedKey = "markpass";
// Configure and enable the access point
setWifiApEnabled.invoke(wifiManager, myConfig, true);
The hotspot comes up correctly, but with no security - no WPA2, WPA, WEP etc.
How can I make it use WPA2 please?