Vue3.0高阶实战:开发高质量音乐Web app
作者:互联网
Vue3.0高阶实战:开发高质量音乐Web app
企业对Vue技术的要求越来越高,但掌握vue3.0高深技术的人才却很少。本课程将通过编写出一个真实的,高度还原音乐播放器的复杂前端项目,让你在实战中获得一线大厂vue3.0高级技术实际开发经验,助你在面试中脱颖而出。
适合人群
一年以上工作经验的前端从业人员
有一定 Vue与 js 基础,且渴望进阶的前端工程师
技术储备要求
熟习HTML、 CSS和JavaScript编程有一定Vue基础和Vue
实际开发经验已经具备Node.js、npm和webpac的使用经验
技术参数
Vue3.0
webpack 4.x @vue/cli 4.5.9
package 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();
// 获取手机一切衔接管理对象(包括对wi-fi,net等衔接的管理)
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager == null) {
return false;
} else {
// 获取NetworkInfo对象
NetworkInfo[] networkInfo = connectivityManager.getAllNetworkInfo();
if (networkInfo != null && networkInfo.length > 0) {
for (NetworkInfo aNetworkInfo : networkInfo) {
// System.out.println(i + "===状态===" + networkInfo[i].getState());
// System.out.println(i + "===类型===" + networkInfo[i].getTypeName());
// 判别当前网络状态能否为衔接状态
if (aNetworkInfo.getState() == NetworkInfo.State.CONNECTED) {
return true;
}
}
}
}
return false;
}
/**- 判别WIFI能否翻开
- @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);
}
/** - 判别能否是3G网络
- @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;
}
/** - 判别是wifi还是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;
}
}
标签:Web,networkInfo,return,Context,ConnectivityManager,app,Vue3.0,context,NetworkInf 来源: https://blog.51cto.com/u_15134633/2695110