/*1, 男 0:女 -1 不公开*/ public static String getGender(Integer gender) { switch (gender) { case 0: return AppApplication.getContext().getString(R.string.female); case 1: return AppApplication.getContext().getString(R.string.male); case -1: return AppApplication.getContext().getString(R.string.private_info); default: return AppApplication.getContext().getString(R.string.private_info); } }
public static boolean isWifiConnected(Context context) { SharedPreferences shp = PreferenceManager.getDefaultSharedPreferences(AppApplication.getContext()); boolean isSupport = shp.getBoolean(context.getString(R.string.pref_wifi), false); ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo(); if (activeNetInfo != null && activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI) { return isSupport; } return false; }
public static String getUserLogo() { return PreferenceUtil.getString( Config.USER_LOG, AppApplication.getContext().getString(R.string.default_user_logo)); }
public static String getUserName() { return PreferenceUtil.getString( Config.USERNAME, AppApplication.getContext().getString(R.string.un_login)); }
public static String getSignatrue() { return PreferenceUtil.getString( Config.USER_SIGNATRUE, AppApplication.getContext().getString(R.string.un_login)); }