Java Code Examples for info.whitebyte.hotspotmanager.WifiApManager

The following examples show how to use info.whitebyte.hotspotmanager.WifiApManager. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    textView1 = (TextView) findViewById(R.id.textView1);

    wifiApManager = new WifiApManager(this);

    // force to show the settings page for demonstration purpose of this method
    wifiApManager.showWritePermissionSettings(true);

    scan();
}
 
Example 2
@Override
public void onReceive(Context context, Intent intent) {
    // TODO: Implement this method
    lg("on recev");

    WifiApManager apMan = new WifiApManager(context);
    state = apMan.isWifiApEnabled();
    lg("state: " + state);

    if (WIFIAP_STATE_CHANGED.equals(intent.getAction())) {
        lg("ap changed");
    }

    if (intent.getBooleanExtra(STATE, false)) {
        state = !state;
        apMan.setWifiApEnabled(null, state);
        lg("Widget button click");
    }

    if (intent.getBooleanExtra(STATE, false) || (WIFIAP_STATE_CHANGED.equals(intent.getAction()) && !intent.getBooleanExtra(STATE, false))) {
        AppWidgetManager awm = AppWidgetManager.getInstance(context);
        ComponentName cn = new ComponentName(context, this.getClass());
        int[] ids = awm.getAppWidgetIds(cn);
        onUpdate(context, awm, ids);
    }

    super.onReceive(context, intent);
}
 
Example 3
Source Project: react-native-wifi-hotspot   Source File: HotspotManager.java    License: ISC License 4 votes vote down vote up
public HotspotManager(Context context) {
    wifi = new WifiApManager(context);
}
 
Example 4
Source Project: WiFiFlutter   Source File: WifiIotPlugin.java    License: MIT License 4 votes vote down vote up
private WifiIotPlugin(Activity poActivity) {
    this.moActivity = poActivity;
    this.moContext = poActivity.getApplicationContext();
    this.moWiFi = (WifiManager) moContext.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
    this.moWiFiAPManager = new WifiApManager(moContext.getApplicationContext());
}