Andorid开发常用开发工具类汇总

原文地址附源码下载地址
在开发中使用一些工具类,能让代码更加简洁,开发效率也更高,下面是我收集的Android中常用的一些开发工具类,如果大家有更好的工具,欢迎私信我。

数据管理的工具类,清理缓存数据

[java] view plaincopy

    import java.io.File;  
    import java.math.BigDecimal;  

    import android.content.Context;  
    import android.os.Environment;  
    import android.text.TextUtils;  

    /** 
     * 本应用数据清除管理器 
     *  
     *  
     */  
    public class DataCleanManager {  
        /** 
         * * 清除本应用内部缓存(/data/data/com.xxx.xxx/cache) * * 
         *  
         * @param context 
         */  
        public static void cleanInternalCache(Context context) {  
            deleteFilesByDirectory(context.getCacheDir());  
        }  

        /** 
         * * 清除本应用所有数据库(/data/data/com.xxx.xxx/databases) * * 
         *  
         * @param context 
         */  
        public static void cleanDatabases(Context context) {  
            deleteFilesByDirectory(new File("/data/data/"  
                    + context.getPackageName() + "/databases"));  
        }  

        /** 
         * * 清除本应用SharedPreference(/data/data/com.xxx.xxx/shared_prefs) * 
         *  
         * @param context 
         */  
        public static void cleanSharedPreference(Context context) {  
            deleteFilesByDirectory(new File("/data/data/"  
                    + context.getPackageName() + "/shared_prefs"));  
        }  

        /** 
         * * 按名字清除本应用数据库 * * 
         *  
         * @param context 
         * @param dbName 
         */  
        public static void cleanDatabaseByName(Context context, String dbName) {  
            context.deleteDatabase(dbName);  
        }  

        /** 
         * * 清除/data/data/com.xxx.xxx/files下的内容 * * 
         *  
         * @param context 
         */  
        public static void cleanFiles(Context context) {  
            deleteFilesByDirectory(context.getFilesDir());  
        }  

        /** 
         * * 清除外部cache下的内容(/mnt/sdcard/android/data/com.xxx.xxx/cache) 
         *  
         * @param context 
         */  
        public static void cleanExternalCache(Context context) {  
            if (Environment.getExternalStorageState().equals(  
                    Environment.MEDIA_MOUNTED)) {  
                deleteFilesByDirectory(context.getExternalCacheDir());  
            }  
        }  

        /** 
         * * 清除自定义路径下的文件,使用需小心,请不要误删。而且只支持目录下的文件删除 * * 
         *  
         * @param filePath 
         * */  
        public static void cleanCustomCache(String filePath) {  
            deleteFilesByDirectory(new File(filePath));  
        }  

        /** 
         * * 清除本应用所有的数据 * * 
         *  
         * @param context 
         * @param filepath 
         */  
        public static void cleanApplicationData(Context context, String... filepath) {  
            cleanInternalCache(context);  
            cleanExternalCache(context);  
            cleanDatabases(context);  
            cleanSharedPreference(context);  
            cleanFiles(context);  
            if (filepath == null) {  
                return;  
            }  
            for (String filePath : filepath) {  
                cleanCustomCache(filePath);  
            }  
        }  

        /** 
         * * 删除方法 这里只会删除某个文件夹下的文件,如果传入的directory是个文件,将不做处理 * * 
         *  
         * @param directory 
         */  
        private static void deleteFilesByDirectory(File directory) {  
            if (directory.isFile()) {  
                directory.delete();  
            } else if (directory != null && directory.exists()  
                    && directory.isDirectory()) {  
                for (File item : directory.listFiles()) {  
                    deleteFilesByDirectory(item);  
                }  
            }  
        }  

        // 获取文件  
        // Context.getExternalFilesDir() --> SDCard/Android/data/你的应用的包名/files/  
        // 目录,一般放一些长时间保存的数据  
        // Context.getExternalCacheDir() -->  
        // SDCard/Android/data/你的应用包名/cache/目录,一般存放临时缓存数据  
        public static long getFolderSize(File file) throws Exception {  
            long size = 0;  
            try {  
                File[] fileList = file.listFiles();  
                for (int i = 0; i < fileList.length; i++) {  
                    // 如果下面还有文件  
                    if (fileList[i].isDirectory()) {  
                        size = size + getFolderSize(fileList[i]);  
                    } else {  
                        size = size + fileList[i].length();  
                    }  
                }  
            } catch (Exception e) {  
                e.printStackTrace();  
            }  
            return size;  
        }  

        /** 
         * 删除指定目录下文件及目录 
         *  
         * @param deleteThisPath 
         * @param filepath 
         * @return 
         */  
        public static void deleteFolderFile(String filePath, boolean deleteThisPath) {  
            if (!TextUtils.isEmpty(filePath)) {  
                try {  
                    File file = new File(filePath);  
                    if (file.isDirectory()) {// 如果下面还有文件  
                        File files[] = file.listFiles();  
                        for (int i = 0; i < files.length; i++) {  
                            deleteFolderFile(files[i].getAbsolutePath(), true);  
                        }  
                    }  
                    if (deleteThisPath) {  
                        if (!file.isDirectory()) {// 如果是文件,删除  
                            file.delete();  
                        } else {// 目录  
                            if (file.listFiles().length == 0) {// 目录下没有文件或者目录,删除  
                                file.delete();  
                            }  
                        }  
                    }  
                } catch (Exception e) {  
                    e.printStackTrace();  
                }  
            }  
        }  

        /** 
         * 格式化单位 
         *  
         * @param size 
         * @return 
         */  
        public static String getFormatSize(double size) {  
            double kiloByte = size / 1024;  
            if (kiloByte < 1) {  
                return size + "Byte";  
            }  

            double megaByte = kiloByte / 1024;  
            if (megaByte < 1) {  
                BigDecimal result1 = new BigDecimal(Double.toString(kiloByte));  
                return result1.setScale(2, BigDecimal.ROUND_HALF_UP)  
                        .toPlainString() + "KB";  
            }  

            double gigaByte = megaByte / 1024;  
            if (gigaByte < 1) {  
                BigDecimal result2 = new BigDecimal(Double.toString(megaByte));  
                return result2.setScale(2, BigDecimal.ROUND_HALF_UP)  
                        .toPlainString() + "MB";  
            }  

            double teraBytes = gigaByte / 1024;  
            if (teraBytes < 1) {  
                BigDecimal result3 = new BigDecimal(Double.toString(gigaByte));  
                return result3.setScale(2, BigDecimal.ROUND_HALF_UP)  
                        .toPlainString() + "GB";  
            }  
            BigDecimal result4 = new BigDecimal(teraBytes);  
            return result4.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString()  
                    + "TB";  
        }  

        public static String getCacheSize(File file) throws Exception {  
            return getFormatSize(getFolderSize(file));  
        }  

    }  

手机号,邮箱,身份证校验工具类

[java] view plaincopy

    import java.util.HashMap;  
    import java.util.regex.Matcher;  
    import java.util.regex.Pattern;  

    public class VerificationUtils {  

        private final static Pattern emailer = Pattern  
                .compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");  
        private static String _codeError;  
        // wi =2(n-1)(mod 11)  
        final static int[] wi = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4,  
                2, 1 };  
        // verify digit  
        final static int[] vi = { 1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2 };  
        private static int[] ai = new int[18];  
        private static String[] _areaCode = { "11", "12", "13", "14", "15", "21",  
                "22", "23", "31", "32", "33", "34", "35", "36", "37", "41", "42",  
                "43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62",  
                "63", "64", "65", "71", "81", "82", "91" };  
        private static HashMap<String, Integer> dateMap;  
        private static HashMap<String, String> areaCodeMap;  
        static {  
            dateMap = new HashMap<String, Integer>();  
            dateMap.put("01", 31);  
            dateMap.put("02", null);  
            dateMap.put("03", 31);  
            dateMap.put("04", 30);  
            dateMap.put("05", 31);  
            dateMap.put("06", 30);  
            dateMap.put("07", 31);  
            dateMap.put("08", 31);  
            dateMap.put("09", 30);  
            dateMap.put("10", 31);  
            dateMap.put("11", 30);  
            dateMap.put("12", 31);  
            areaCodeMap = new HashMap<String, String>();  
            for (String code : _areaCode) {  
                areaCodeMap.put(code, null);  
            }  
        }  

        /** 
         * 验证手机号 
         *  
         * @param str 
         * @return 
         */  
        public static boolean isMobile(String str) {  
            Pattern p = null;  
            Matcher m = null;  
            boolean b = false;  
            p = Pattern.compile("^[1][3,4,5,8,7][0-9]{9}$");  
            // p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");  
            m = p.matcher(str);  
            b = m.matches();  
            return b;  
        }  

        /** 
         * 验证邮箱 
         *  
         * @param email 
         * @return 
         */  
        public static boolean isEmail(String email) {  
            if (email == null || email.trim().length() == 0)  
                return false;  
            return emailer.matcher(email).matches();  
        }  

        public static boolean isEmpty(String input) {  
            if (input == null || "".equals(input))  
                return true;  

            for (int i = 0; i < input.length(); i++) {  
                char c = input.charAt(i);  
                if (c != ' ' && c != '\t' && c != '\r' && c != '\n') {  
                    return false;  
                }  
            }  
            return true;  
        }  

        /** 
         * 验证位数 
         * @param code 
         * @return 
         */  
        public static boolean verifyLength(String code) {  
            int length = code.length();  
            if (length == 15 || length == 18) {  
                return true;  
            } else {  
                return false;  
            }  
        }  

        /** 
         * 验证省区 
         * @param code 
         * @return 
         */  
        public static boolean verifyAreaCode(String code) {  
            String areaCode = code.substring(0, 2);  
            if (areaCodeMap.containsKey(areaCode)) {  
                return true;  
            } else {  
                return false;  
            }  
        }  

        /** 
         * 验证生日 
         * @param code 
         * @return 
         */  
        public static boolean verifyBirthdayCode(String code) {  
            String month = code.substring(10, 12);  
            boolean isEighteenCode = (18 == code.length());  
            if (!dateMap.containsKey(month)) {  
                return false;  
            }  
            String dayCode = code.substring(12, 14);  
            Integer day = dateMap.get(month);  
            String yearCode = code.substring(6, 10);  
            Integer year = Integer.valueOf(yearCode);  

            if (day != null) {  
                if (Integer.valueOf(dayCode) > day || Integer.valueOf(dayCode) < 1) {  
                    return false;  
                }  
            } else {  
                if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {  
                    if (Integer.valueOf(dayCode) > 29  
                            || Integer.valueOf(dayCode) < 1) {  
                        return false;  
                    }  
                } else {  
                    if (Integer.valueOf(dayCode) > 28  
                            || Integer.valueOf(dayCode) < 1) {  
                        return false;  
                    }  
                }  
            }  
            return true;  
        }  

        public static boolean containsAllNumber(String code) {  
            String str = "";  
            if (code.length() == 15) {  
                str = code.substring(0, 15);  
            } else if (code.length() == 18) {  
                str = code.substring(0, 17);  
            }  
            char[] ch = str.toCharArray();  
            for (int i = 0; i < ch.length; i++) {  
                if (!(ch[i] >= '0' && ch[i] <= '9')) {  
                    return false;  
                }  
            }  
            return true;  
        }  



        public static boolean verify(String idcard) {  
            if (!verifyLength(idcard)) {  
                return false;  
            }  
            if (!containsAllNumber(idcard)) {  
                return false;  
            }  

            String eifhteencard = "";  
            if (idcard.length() == 15) {  
                eifhteencard = uptoeighteen(idcard);  
            } else {  
                eifhteencard = idcard;  
            }  
            if (!verifyAreaCode(eifhteencard)) {  
                return false;  
            }  
            if (!verifyBirthdayCode(eifhteencard)) {  
                return false;  
            }  
            if (!verifyMOD(eifhteencard)) {  
                return false;  
            }  
            return true;  
        }  

        public static boolean verifyMOD(String code) {  
            String verify = code.substring(17, 18);  
            if ("x".equals(verify)) {  
                code = code.replaceAll("x", "X");  
                verify = "X";  
            }  
            String verifyIndex = getVerify(code);  
            if (verify.equals(verifyIndex)) {  
                return true;  
            }  
            // int x=17;  
            // if(code.length()==15){  
            // x=14;  
            // }  
            return false;  
        }  

        public static String getVerify(String eightcardid) {  
            int remaining = 0;  

            if (eightcardid.length() == 18) {  
                eightcardid = eightcardid.substring(0, 17);  
            }  

            if (eightcardid.length() == 17) {  
                int sum = 0;  
                for (int i = 0; i < 17; i++) {  
                    String k = eightcardid.substring(i, i + 1);  
                    ai[i] = Integer.parseInt(k);  
                }  

                for (int i = 0; i < 17; i++) {  
                    sum = sum + wi[i] * ai[i];  
                }  
                remaining = sum % 11;  
            }  

            return remaining == 2 ? "X" : String.valueOf(vi[remaining]);  
        }  

        public static String uptoeighteen(String fifteencardid) {  
            String eightcardid = fifteencardid.substring(0, 6);  
            eightcardid = eightcardid + "19";  
            eightcardid = eightcardid + fifteencardid.substring(6, 15);  
            eightcardid = eightcardid + getVerify(eightcardid);  
            return eightcardid;  
        }  
    }  

sharedPreferences封装工具类

[java] view plaincopy

    import android.content.Context;  
    import android.content.SharedPreferences;  
    import android.content.SharedPreferences.Editor;  

    public class SharedPreferencesUtil {  
        /** 
         * 保存在手机里面的文件名 
         */  
        private static final String SP_NAME = "sp_name";  

        public static void setStringParam(Context context, String key, String value) {  
            SharedPreferences sp = context.getSharedPreferences(SP_NAME,  
                    Context.MODE_PRIVATE);  
            Editor edit = sp.edit();  
            edit.putString(key, value);  
            edit.commit();  
            key = null;  
            value = null;  
            edit = null;  
            sp = null;  
            context = null;  
        }  

        /** 
         * 保存字符串数据类型 
         *  
         * @param context 
         * @param keys 
         * @param values 
         */  
        public static void setStringParams(Context context, String[] keys,  
                String[] values) {  
            SharedPreferences sp = context.getSharedPreferences(SP_NAME,  
                    Context.MODE_PRIVATE);  
            Editor edit = sp.edit();  
            for (int i = 0; i < keys.length; i++) {  
                edit.putString(keys[i], values[i]);  
            }  
            keys = null;  
            values = null;  
            edit.commit();  
            edit = null;  
            sp = null;  
            context = null;  
        }  

        /** 
         * 保存所有数据类型 保存数据的方法,我们需要拿到保存数据的具体类型,然后根据类型调用不同的保存方法 
         *  
         * @param context 
         * @param key 
         * @param object 
         */  
        public static void setParam(Context context, String key, Object object) {  

            String type = object.getClass().getSimpleName();  
            SharedPreferences sp = context.getSharedPreferences(SP_NAME,  
                    Context.MODE_PRIVATE);  
            SharedPreferences.Editor editor = sp.edit();  

            if ("String".equals(type)) {  
                editor.putString(key, (String) object);  
            } else if ("Integer".equals(type)) {  
                editor.putInt(key, (Integer) object);  
            } else if ("Boolean".equals(type)) {  
                editor.putBoolean(key, (Boolean) object);  
            } else if ("Float".equals(type)) {  
                editor.putFloat(key, (Float) object);  
            } else if ("Long".equals(type)) {  
                editor.putLong(key, (Long) object);  
            }  

            key = null;  
            object = null;  
            editor.commit();  
            editor = null;  
            sp = null;  
            context = null;  
        }  

        /** 
         * 得到保存数据的方法,我们根据默认值得到保存的数据的具体类型,然后调用相对于的方法获取值 
         *  
         * @param context 
         * @param key 
         * @param defaultObject 
         * @return 
         */  
        public static Object getParam(Context context, String key,  
                Object defaultObject) {  
            String type = defaultObject.getClass().getSimpleName();  
            SharedPreferences sp = context.getSharedPreferences(SP_NAME,  
                    Context.MODE_PRIVATE);  

            if ("String".equals(type)) {  
                return sp.getString(key, (String) defaultObject);  
            } else if ("Integer".equals(type)) {  
                return sp.getInt(key, (Integer) defaultObject);  
            } else if ("Boolean".equals(type)) {  
                return sp.getBoolean(key, (Boolean) defaultObject);  
            } else if ("Float".equals(type)) {  
                return sp.getFloat(key, (Float) defaultObject);  
            } else if ("Long".equals(type)) {  
                return sp.getLong(key, (Long) defaultObject);  
            }  

            return null;  
        }  

    }  

Service工具类

[java] view plaincopy

    import java.util.List;  

    import android.app.ActivityManager;  
    import android.content.Context;  

    /** 
     * 服务是否运行检测帮助类 
     *  
     */  
    public class ServiceUtil {  

        /** 
         * 判断服务是否后台运行 
         *  
         * @param context 
         *            Context 
         * @param className 
         *            判断的服务名字 
         * @return true 在运行 false 不在运行 
         */  
        public static boolean isServiceRun(Context mContext, String className) {  
            boolean isRun = false;  
            ActivityManager activityManager = (ActivityManager) mContext  
                    .getSystemService(Context.ACTIVITY_SERVICE);  
            List<ActivityManager.RunningServiceInfo> serviceList = activityManager  
                    .getRunningServices(40);  
            int size = serviceList.size();  
            for (int i = 0; i < size; i++) {  
                if (serviceList.get(i).service.getClassName().equals(className) == true) {  
                    isRun = true;  
                    break;  
                }  
            }  
            return isRun;  
        }  

    }  

Log日志工具类

[java] view plaincopy

    import android.util.Log;  

    /** 
     * Log显示工具类 
     */  
    public class LogUtil {  

        /** 
         * 开发 
         */  
        private final static int DEVELOP = 0;  

        /** 
         * 测试 
         */  
        private final static int TEST = 1;  

        /** 
         * 上线 
         */  
        private final static int ONLINE = 2;  

        /** 
         * 当前状态 
         */  
        private final static int NOWSTATE = DEVELOP;  

        public static void info(String msg) {  
            info("volunteer", msg);  
        }  

        public static void info(String TAG, String msg) {  
            switch (NOWSTATE) {  
            case DEVELOP:  
                Log.i(TAG, "develop:---" + msg);  
                break;  
            case TEST:  
                Log.i(TAG, "test:---" + msg);  
                break;  
            case ONLINE:  

                break;  

            }  
        }  
    }  

MD5 加密工具类

[java] view plaincopy

    public final class MD5Utils {  
        private static final char Digit[] = {  
            '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',   
            'a', 'b', 'c', 'd', 'e', 'f'  
        };  
        private static final byte PADDING[] = {  
            -128, 0, 0, 0, 0, 0, 0, 0, 0, 0,   
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   
            0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   
            0, 0, 0, 0  
        };  
        private static long state[] = new long[4];  
        private static long count[] = new long[2];  
        private static byte buffer[] = new byte[64];  
        private static String digestHexStr;  
        private static byte digest[] = new byte[16];  

        private MD5Utils() {  
        }  

        /** 
         * 没有加盐 小写输出 
         * @param s 
         * @return 
         */  
        public static String toMD5(String s) {  
            md5Init();  
            md5Update(s.getBytes(), s.length());  
            md5Final();  
            digestHexStr = "";  
            for(int i = 0; i < 16; i++)  
                digestHexStr = digestHexStr + byteHEX(digest[i]);  

            return digestHexStr;  
        }  

        private static void md5Init() {  
            count[0] = 0L;  
            count[1] = 0L;  
            state[0] = 0x67452301L;  
            state[1] = 0xefcdab89L;  
            state[2] = 0x98badcfeL;  
            state[3] = 0x10325476L;  
        }  



        private static long F(long x, long y, long z) {  
            return (x & y) | ((~x) & z);   
        }  

        private static long G(long x, long y, long z) {  
            return (x & z) | (y & (~z));   
        }  

        private static long H(long x, long y, long z) {  
            return x ^ y ^ z;  
        }  

        private static long I(long x, long y, long z) {  
            return y ^ (x | (~z));  
        }  

        private static long FF(long l, long l1, long l2, long l3,   
                long l4, long l5, long l6) {  
            l += F(l1, l2, l3) + l4 + l6;  
            l = (int)l << (int)l5 | (int)l >>> (int)(32L - l5);  
            l += l1;  
            return l;  
        }  

        private static long GG(long l, long l1, long l2, long l3,   
                long l4, long l5, long l6) {  
            l += G(l1, l2, l3) + l4 + l6;  
            l = (int)l << (int)l5 | (int)l >>> (int)(32L - l5);  
            l += l1;  
            return l;  
        }  

        private static long HH(long l, long l1, long l2, long l3,   
                long l4, long l5, long l6) {  
            l += H(l1, l2, l3) + l4 + l6;  
            l = (int)l << (int)l5 | (int)l >>> (int)(32L - l5);  
            l += l1;  
            return l;  
        }  

        private static long II(long l, long l1, long l2, long l3,   
                long l4, long l5, long l6) {  
            l += I(l1, l2, l3) + l4 + l6;  
            l = (int)l << (int)l5 | (int)l >>> (int)(32L - l5);  
            l += l1;  
            return l;  
        }  

        private static void md5Update(byte abyte0[], int i) {  
            byte abyte1[] = new byte[64];  
            int k = (int)(count[0] >>> 3) & 0x3f;  
            if ((count[0] += i << 3) < (long)(i << 3))  
                count[1]++;  
            count[1] += i >>> 29;  
            int l = 64 - k;  
            int j;  
            if (i >= l) {  
                md5Memcpy(buffer, abyte0, k, 0, l);  
                md5Transform(buffer);  
                for(j = l; j + 63 < i; j += 64) {  
                    md5Memcpy(abyte1, abyte0, 0, j, 64);  
                    md5Transform(abyte1);  
                }  
                k = 0;  
            } else {  
                j = 0;  
            }  
            md5Memcpy(buffer, abyte0, k, j, i - j);  
        }  

        private static void md5Final() {  
            byte abyte0[] = new byte[8];  
            Encode(abyte0, count, 8);  
            int i = (int)(count[0] >>> 3) & 0x3f;  
            int j = i >= 56 ? 120 - i : 56 - i;  
            md5Update(PADDING, j);  
            md5Update(abyte0, 8);  
            Encode(digest, state, 16);  
        }  

        private static void md5Memcpy(byte abyte0[], byte abyte1[], int i, int j, int k) {  
            for(int l = 0; l < k; l++)  
                abyte0[i + l] = abyte1[j + l];  
        }  

        private static void md5Transform(byte abyte0[]) {  
            long l = state[0];  
            long l1 = state[1];  
            long l2 = state[2];  
            long l3 = state[3];  
            long al[] = new long[16];  
            Decode(al, abyte0, 64);  
            l = FF(l, l1, l2, l3, al[0], 7L, 0xd76aa478L);  
            l3 = FF(l3, l, l1, l2, al[1], 12L, 0xe8c7b756L);  
            l2 = FF(l2, l3, l, l1, al[2], 17L, 0x242070dbL);  
            l1 = FF(l1, l2, l3, l, al[3], 22L, 0xc1bdceeeL);  
            l = FF(l, l1, l2, l3, al[4], 7L, 0xf57c0fafL);  
            l3 = FF(l3, l, l1, l2, al[5], 12L, 0x4787c62aL);  
            l2 = FF(l2, l3, l, l1, al[6], 17L, 0xa8304613L);  
            l1 = FF(l1, l2, l3, l, al[7], 22L, 0xfd469501L);  
            l = FF(l, l1, l2, l3, al[8], 7L, 0x698098d8L);  
            l3 = FF(l3, l, l1, l2, al[9], 12L, 0x8b44f7afL);  
            l2 = FF(l2, l3, l, l1, al[10], 17L, 0xffff5bb1L);  
            l1 = FF(l1, l2, l3, l, al[11], 22L, 0x895cd7beL);  
            l = FF(l, l1, l2, l3, al[12], 7L, 0x6b901122L);  
            l3 = FF(l3, l, l1, l2, al[13], 12L, 0xfd987193L);  
            l2 = FF(l2, l3, l, l1, al[
LiveKit 本地部署实战:从零搭建安全实时通信环境(Caddy+HTTPS) 本文详细介绍了如何从零开始搭建LiveKit本地部署环境,结合Caddy服务器实现HTTPS安全通信。通过环境准备、证书生成、服务配置到前端客户端集成的完整流程,帮助开发者快速构建实时音视频应用,特别适合需要安全实时通信的场景。 阅读详情

相关推荐

CentOS7无网环境实战:MySQL8.0完整离线安装与避坑指南(附依赖包下载)

本文详细介绍了在CentOS7无网环境下MySQL8.0的完整离线安装流程,包括依赖包获取、系统预处理、MySQL二进制安装、服务配置与优化等关键步骤。特别针对离线安装的特殊需求,提供了从依赖包下载到服务调优的全链路解决方案,帮助用户在企业内网或隔离环境中高效部署MySQL数据库。

bush的博客 174

Android开发十大必备工具(图文)

通过ProGuard可得到更精简的文件,也就意味着网络传输更省时,装载速度更快,占用内存空间更小。你可以将模拟器与AVD结合在一起模拟目标移动设备的运行环境,但更全面地进行测试,你还是需要一个真正的移动设备,因为模拟器虽然功能强大,但它毕竟不是实际使用的手机,用户也不可能使用模拟器运行应用程序,所以实际移动设备也是测试环节必不可少的工具。当程序员容易,当一个优秀的程序员是需要不断学习的,从初级程序员到高级程序员,从初级架构师到资深架构师,或者走向管理,从技术经理到技术总监,每个阶段都需要掌握不同的能力。

2401_84545016的博客 2680

Silvaco TCAD实战 | SiC MOSFET工艺仿真与关键参数DOE分析

本文详细介绍了使用Silvaco TCAD进行SiC MOSFET工艺仿真与关键参数DOE分析的实战方法。通过外延生长建模、离子注入工艺调试等步骤,结合DOE分析优化器件性能,帮助工程师在设计阶段预判电学特性,提升产品可靠性。文章还分享了网格划分、界面态建模等实用技巧,助力实现从仿真到产品的闭环验证。

weixin_30235225的博客 505

Andorid开发之常用工具类Utils

Andorid开发之常用工具类utilsAndroid项目中开发中常用的一些方法比如,加载布局、dp和px互转、添加字符串数组、获取图片等方法,我们可以创建一个工具类,代码如下:package pengchao.p2pmoney.Utils; import android.content.Context; import android.content.res.ColorStateList; im...

qq_32625999的博客 397

Python实现高光谱图像生成与增强:从RGB到多光谱转换(附完整代码)

本文分享一个基于Python的实用工具,能够将普通RGB图像转换为模拟高光谱图像,并进一步生成增强的彩色可见图像。为了直观展示图像细节,程序通过对特定波段的组合,生成了一幅增强的 RGB 彩色图像。该函数的主要目标是将一张普通的 RGB 图像转换为包含多个波段的高光谱图像。通过该函数,我们能直观地看到高光谱图像经过波段组合后所得到的彩色图像效果。通过以上代码,我们可以实现对海量图像数据的自动化处理,极大地提升工作效率。已附在文中,欢迎下载测试!通过以上步骤,我们可以生成一幅包含多个光谱波段信息的图像。

m0_74824642的博客 3665

python模拟银行交易流水

模拟自动生成银行交易流水,其中包括:入账账号、出账账号、交易金额、交易余额、交易时间、出入表示关键字段

qq_31823889的博客 2910

Andorid开发工具类之——SPUtils

SharedPreferences 是开发中经常用到的保存数据的一种方式,之前在网上看到一些类似的工具类,但是都没有达到理想的要求,搜集了网上的资料后自己又改造了代码,现在达到了理想的要求,上代码: public class SPUtils { /** * 保存在手机里面的文件名 */ public static final String FILE_NA

发光棒的博客 8039

解决Jupyter Notebook中Plotly图表显示问题

摘要:在Jupyter Notebook中使用Plotly绘图时遇到图表无法显示的问题。通过分析发现Python 3.12版本与Jupyter存在兼容性问题。解决方案是将Python降级到3.11版本,重新创建虚拟环境后图表正常显示。这表明版本兼容性对数据可视化工具至关重要,环境配置检查是解决问题的关键步骤。该案例为遇到类似问题的开发者提供了参考方案。

m0_74337424的博客 124

andorid 开发常用官网

android开发者官网:https://developer.android.comhttps://source.android.com/security/overview/kernel-security 也是android官网十分重要的网站 http://square.github.io/#android 膜拜的网站 :OKHttp,picasso,Retrofit,dragger,otto等

ms09421的专栏 1369

2023年12月机器人技术等级考试试卷(三级理论) 试题解析

2023年12月机器人技术等级考试试卷(三级理论) 试题解析

http://www.cierobot.com 4095

Windows 11 安装 MySQL 8.4:安装包方式、下载、安装、使用

本文详细介绍了在 Windows 11 系统下通过 MSI 安装包方式安装 MySQL 8.4 LTS 社区版的完整流程,包括版本选择、下载、自定义安装路径、服务配置、日志设置、示例数据库创建及后续使用方法。同时提供了命令行客户端与图形化工具 DBeaver 的连接与操作演示,适合初学者和开发者快速搭建本地 MySQL 开发环境。

寒水馨 · 轻量级技术文档 · hanshuixin.org 2255

android 快速开发工具类

FastAndrUtils 项目地址:570622566/FastAndrUtils  简介:android 快速开发工具类 更多:作者   提 Bug   官网    标签:   Fastandrutils 是一套整理修改整合的 android 开发常用的工具类。 这样可以减少复制粘贴代码,从而减少重复代码,也不用为了一个常用的功能去谷歌百度,让代码更简洁,让开发更高效。 同...

未来很长,但我会努力的走下去。 658

量化交易 米筐 案例:市值因子选股策略

案例:市值因子的选股策略 1.结果 获得超额收益 年化 49% 2. 从股票中选择市值小的股票 选定财务数据筛选 进行每日调仓(多因子选股调仓 周期频率会小一些) 3. 代码 估值有关指标 # 在沪深300股票中,选出市值比较小的10只股票 # 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。 def init(context): # 沪深300组合 stocks = index_components('000300.XSHG') # 沪深3

廷益_飞鸟的博客 2311

android系统二次开发,Andorid系统二次开发界面

Andorid系统二次开发界面给大家介绍完外观,下面我们一起再来看下魅族MX的系统界面。本次魅族MX仍然采用的是Andorid操作系统,并且加入了二次开发界面。UI界面整体上保持了和M9的特色,不过增加了很多全新的功能。主菜单主菜单UI界面的好坏直接影响用户的感受,从M9到MX整个UI界面并没有太大的改变。魅族的UI界面仍然取消了菜单功能,所有的程序都是左右进行滑动。默认界面下包括搜索以及主要...

weixin_39925350的博客 959

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Andorid中xml资料汇总

为了方便大家学习特意整理了下有关xml的资料希望大家可以多多的学习下。 Android解析xml文件的3种方式 http://www.eoeandroid.com/thread-210323-1-1.html Android 原有的xml http://www.eoeandroid.com/thread-75460-1-1.html 利用反射机制,封装 SAX解析类,从而解析网络xml文

Android小子的博客笔记 501

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Andorid开发中的paint常用属性解析

paint在Android自定义控件中有着举足轻重的地位,基本上我们所有的自绘控件都离不开它,原生的各种炫酷的效果,比如刮刮乐,滤镜等等都运用到了paint,下面我们就针对paint的常用api做个解析; PaintmPaint = new Paint(); //初始化 mPaint.setColor(Color.RED);// 设置颜色 mPaint.setARGB(25...

EugeneYoung的博客 366

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

Android开发常用框架汇总

作为一名程序猿,好的工具会让你在搬运工的道路上越走越远。以下框架是AC在开发过程中经常会使用到的一些好的框架。列在这里做一个小小的总结,包含但不限于此。 响应式编程 RxJava https://github.com/ReactiveX/RxJava RxAndroid https://github.com/ReactiveX/RxAndroid 消息通信 E

qq_23174861的博客 1319

andorid作业一

andorid作业 P23.4 代码 效果: P25.5 代码: 效果:

Mr_lax的博客 302

Andorid SQLite数据库开发基础教程(3)

Andorid SQLite数据库开发基础教程(3) 数据库生成方式 数据库的生成有两种方式,一种是使用数据库管理工具生成的数据库,我们将此类数据库称为预设数据库,另一种是使用代码生成的数据库。 使用SQLiteManager管理数据库 SQLiteMananger是SQLite图形化管理工具。使用该工具,开发者可以快速创建数据库,添加表和列、索引、视图、触发器等数据库对象。本节将讲解如何...

大学霸__IT达人 301

andorid 开发

基础简介: 基于 Liunx 平台的开放性操作系统的总称,该平台由操作系统 中间件 用户界面和应用软件做成。 系统架构: 高层到底层分为: 应用程序层,架构层, 系统运行库层,Liunx核心层。 应用程序框架层: 开发人员访问的核心应用程序使用API框架: 丰富可以扩展的试图views ,构建应用程序 包括列表 按钮 甚至嵌入web 浏览器 Content Provider: 使得应用程序可以访问另外一个应用程序,或者共享他们自己数据 资源管理器: 提供非代码资源的访问本地字符串,图形,和布局文件( lay

上后谈感情的博客 417

android studio 常用快捷键

andorid  studio 常用快捷键  代码提示  Ctrl+Alt+Space(空格键)  选中代码,连续按会有其他效果 Ctrl+W  代码上下移动  Ctrl+Shift+Up/Down  复制当前行到小一行 Ctrl + D  剪切   Ctrl + X   删除  Ctrl + Y  在类中的方法间移动  alt + up /down  打开一个file

u014310183的专栏 318

Andorid反编译App(转载)

Andorid反编译App 转载请标明出处:http://blog.youkuaiyun.com/lmj623565791/article/details/23564065 开发的过程中,有时候可能会去使用别的app里面的图片,参考布局甚至代码等,但是一般的.apk都是经过代码混淆的,这里分享下使用一些工具进行反编译.apk文件,主要就是软件的分享和教大家如何使用。 1、...

anyu8718的博客 101

Andorid开发工具类之——SPUtils(加入泛型,更智能)

SharedPreferences 是开发中经常用到的保存数据的一种方式,之前在网上看到一些类似的工具类,但是都没有达到理想的要求,搜集了网上的资料后自己又改造了代码,现在达到了理想的要求, 加入泛型方法,可以根据输入的类型自动返回输入的数据类型,不需要强制转换 例如: 保存: SPUtils.put(this, "userName", "admin"); SPUtils.put(th

发光棒的博客 3100
上一篇: Andorid开发常用开发工具类汇总
下一篇: Android常用开发工具类汇总
coley-wu
博客等级 码龄12年 859粉丝 112原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值