Posts

Showing posts from April, 2015

Create Your Own SSID and create Hotspot On Click ( Open Connection)

To start hotspot you have to add few lines and its done WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); wifi.setWifiEnabled(false); Method[] methods = wifi.getClass().getDeclaredMethods();    for (Method method : methods) {        if (method.getName().equals("setWifiApEnabled")) {            try {                            method.invoke(wifi, null, false);            } catch (Exception ex) {            }            break;        }    } setssid(true); private void setssid(boolean enable){ WifiManager mWifiManager = (WifiManager) getSystemService(WIFI_SERVICE); try{  Method getWifiConfig = mWifiManager.getClass().getMethod("getWifiApConfiguration",null);        WifiConfiguration wifiConf  = (WifiConfiguration)getWifiConfig.invoke(mWifiManager, null);        wifiConf.SSID = "Radio Channel";      wifiConf.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgori