Android add wifi profile for static programmatically

First of all, the Full Android project for download.

WifiSetting

Simply desc the code.  MainActivity.saveWepConfig(String ssid, String password) adding the Wifi Profile

This version is for WPA, and setting the password to wc.preSharedKey, for WEP, password will store at wc.wepKeys[0], and setting the wc.wepTxKeyIndex=0.

The allowXXX.set, can accept multiply set, just set all the choice is OK.

WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiConfiguration . . . → Read More: Android add wifi profile for static programmatically

Debug a Android program when it running (ie, for service debugging)

First of all, compile you APK in debug mode true, you can done by

change the AndroidManifest.xml, add “android:debug=’true’”, at (somewhere ^.^) application.
[I use this] Use ant build, compile your APK use “ant debug”

Connect your device to PC, and try “adb devices” to find if your device connect normally.

Install your APK to device, and start the program.

Start . . . → Read More: Debug a Android program when it running (ie, for service debugging)