Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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.

— asked October 4th 2010 by Yacin Bahi
  • ssid
  • wifi
1 Comment
  • I guess this could be done with a custom module. I'm going to give it a try and will post my findings if any.

    — commented October 5th 2010 by Yacin Bahi

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 );
    }
    
    — answered August 6th 2013 by Eduardo Gomez
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.