Skip to content

Instantly share code, notes, and snippets.

@egomez99
Created August 6, 2013 22:43
Show Gist options
  • Save egomez99/6169481 to your computer and use it in GitHub Desktop.
Save egomez99/6169481 to your computer and use it in GitHub Desktop.
Get WIFI SSID (network name) from Android module
// 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 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment