Access SSID and wifi credentials
> Is there a way to access the current wifi settings used by the phone ?
> I'm looking for a way to access the SSID and WEP/WAP key of the wifi that the phone is using.
> Thx.
2 Answers
-
Just in case, if anyone is looking a simple sample for Android to get SSID, feel free to have a look here: Android Module. Tested on 3.1.1.GA on Android 2.3.5 & 4.1.2.
Simple sample:
// open a single window var win = Ti.UI.createWindow({ backgroundColor : 'white' }); var label = Ti.UI.createLabel(); win.add(label); win.open(); // TODO: write your module tests here var wifissid = require('org.appcelerator.wifissid'); Ti.API.info("module is => " + wifissid); label.text = wifissid.example(); Ti.API.info("module exampleProp is => " + wifissid.exampleProp); wifissid.exampleProp = "This is a test value"; if (Ti.Platform.name == "android") { var WIFI_SSID = wifissid.getWifiSSID(); Ti.API.info( "####### WIFI SSID: "+ WIFI_SSID ); alert("WIFI_SSID: "+ WIFI_SSID ); }
-
I don't think you can. Here's what you have access to as part of the Platform API.