1
  1. Is it possible to activate programmatically the mobile hotspot on a android phone?
  2. Is it possible if the mobile spot is activated, to read the configuration (SSID, Password, Security WPA,...) of the phones mobile hotspot programmatically in an app to send this for example by NFC to another phone?

The sources I found say "It is not possible, there is no SDK with this feature", but this sources are between 2010 and 2011.

Thanks for your answers!

WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
ms88-aut
  • 375
  • 4
  • 13
  • There is no such thing in android documentation. I am working on a possibility to look at the source code of android an do something. How far have you gone ? – 10101010 Jan 08 '13 at 10:03
  • I didn't find something in this direction. Maybe it is now possible because of security aspects to activate the phone by app as mobile hotspot or read the network key for this... – ms88-aut Jan 08 '13 at 20:18

1 Answers1

1

Yes, try this method...

     WifiManager wifiManager = (WifiManager) getBaseContext()
            .getSystemService(Context.WIFI_SERVICE);
          wifiManager.setWifiEnabled(false);
try {
    wifiManager.getClass()
            .getMethod("setWifiApEnabled",
                               WifiConfiguration.class,
                               boolean.class)
        .invoke(wifiManager, null, false);
} catch (Exception e) {
    Log.e(Main.TAG, "Cannot call: setWifiApEnabled", e);
}
timonvlad
  • 1,046
  • 3
  • 13
  • 31