Skip to content

Instantly share code, notes, and snippets.

@javawolfpack
Created June 22, 2015 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javawolfpack/36ea12e1216cdaba016a to your computer and use it in GitHub Desktop.
Save javawolfpack/36ea12e1216cdaba016a to your computer and use it in GitHub Desktop.
WiFi Lock Example from lecture on different version
WifiLock lk;
final int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
if (sdkVersion >= Build.VERSION_CODES.HONEYCOMB_MR1) {
Log.d(TAG, "hi-perf wifi lock");
lk = wfManager.createWifiLock(3, "LockTag");
}
else{
lk = wfManager.createWifiLock(WifiManager.WIFI_MODE_FULL, "LockTag");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment