Download:Spring Security technology stack develops enterprise-level authentication and authorization

The whole network is the most detailed explanation of Spring Security, Spring Social, Spring Security OAuth three technologies to develop secure REST services, thoroughly master the mainstream identity authentication and authorization methods of front-line Internet companies.

This course is designed for Java developers who have some development experience and want to learn more about certification and licensing. If you are interested in design patterns and ideas, this course will be of great help to you

Pre-school essential basic 丨 technology JavaWeb Spring 丨 Maven package based on com. Chengxinet. Bobo. Utils; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.telephony.TelephonyManager; / * *

  • Created by Administrator on 2016/1/7.

    * /

    public class NetworkUtils {

    public static boolean isNetworkAvailable(Context c) {

    Context context = c.getApplicationContext();

    // Obtain all connection management objects of mobile phones (including wi-fi, NET and other connection management)

    ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

    if (connectivityManager == null) {

    return false;

    } else {

    // Get the NetworkInfo object

    NetworkInfo[] networkInfo = connectivityManager.getAllNetworkInfo();

    if (networkInfo ! = null && networkInfo.length > 0) {

    for (NetworkInfo aNetworkInfo : networkInfo) {

    / / System. Out. Println (I + “state = = = = = =” + networkInfo [I] getState ());

    / / System. Out. Println (I + “type = = = = = =” + networkInfo [I] getTypeName ());

    // Check whether the current network state is connected

    if (aNetworkInfo.getState() == NetworkInfo.State.CONNECTED) {

    return true;

    }

    }

    }

    }

    return false;

    }

    / * *
    • Check whether WIFI can be turned on
    • @param context
    • @return */ public static boolean isWifiEnabled(Context context) { ConnectivityManager mgrConn = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); TelephonyManager mgrTel = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); return ((mgrConn.getActiveNetworkInfo() ! = null && mgrConn .getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED) || mgrTel .getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS); } / * *
    • See if it’s a 3G network
    • @param context
    • @return */ public static boolean is3rd(Context context) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkINfo = cm.getActiveNetworkInfo(); if (networkINfo ! = null && networkINfo.getType() == ConnectivityManager.TYPE_MOBILE) { return true; } return false; } / * *
    • Check whether it’s wifi or 3G
    • @param context
    • @return

      */

      public static boolean isWifi(Context context) {

      ConnectivityManager cm = (ConnectivityManager) context

      .getSystemService(Context.CONNECTIVITY_SERVICE);

      NetworkInfo networkINfo = cm.getActiveNetworkInfo();

      if (networkINfo != null

      && networkINfo.getType() == ConnectivityManager.TYPE_WIFI) {

      return true;

      }

      return false;

      }

      }