I\'m trying to set my Android device to be an Access-Point using the code I\'ve seen here before:
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI
See how I got this working at Android 2.3 wifi hotspot API.
Before Invoking the Method "setWifiApEnabled" you need to call "getWifiApConfiguration" to get the default WifiConfiguration
Then change the SSID and Password and then invoke "setWifiApConfiguration" with the modified WifiConfiguration and after that call "setWifiApEnabled"
Here is the Code.
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
getWifiConfig = wifi.getClass().getMethod("getWifiApConfiguration",null);
WifiConfiguration myConfig = (WifiConfiguration) getWifiConfig.invoke(wifi,null);
myConfig.SSID = "Hello World";
setWifiConfig = wifi.getClass().getMethod("setWifiApConfiguration",WifiConfiguration.class);
setWifiConfig.invoke(wifi,new Object[]{myConfig,true});
enableWifi = wifi.getClass().getMethod("setWifiEnabled",WifiConfiguration.class,boolean.class);
enableWifi.invoke(wifi,null,true);