This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SqliteUtils { | |
| private static volatile SqliteUtils instance; | |
| private DbHelper dbHelper; | |
| private SQLiteDatabase db; | |
| private SqliteUtils(Context context) { | |
| dbHelper = new DbHelper(context); | |
| db = dbHelper.getWritableDatabase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void startActivitySafely(Intent intent) { | |
| intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
| try { | |
| startActivity(intent); | |
| } catch (ActivityNotFoundException e) { | |
| Toast.makeText(this, R.string.activity_not_found, | |
| Toast.LENGTH_SHORT).show(); | |
| } catch (SecurityException e) { | |
| Toast.makeText(this, R.string.activity_not_found, | |
| Toast.LENGTH_SHORT).show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.jwetherell.motion_detection.image; | |
| import java.io.ByteArrayOutputStream; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.graphics.Color; | |
| import android.graphics.Matrix; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.cylan.efamily.utils; | |
| import android.annotation.SuppressLint; | |
| import android.os.Environment; | |
| import android.os.StatFs; | |
| import java.io.BufferedReader; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.io.InputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hunt.utils; | |
| import java.security.InvalidKeyException; | |
| import java.security.MessageDigest; | |
| import java.security.NoSuchAlgorithmException; | |
| import java.security.interfaces.RSAPrivateKey; | |
| import java.security.interfaces.RSAPublicKey; | |
| import javax.crypto.BadPaddingException; | |
| import javax.crypto.Cipher; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (Build.VERSION.SDK_INT >= 18) { | |
| // The UI options currently enabled are represented by a bitfield. | |
| // getSystemUiVisibility() gives us that bitfield. | |
| int uiOptions = getWindow().getDecorView().getSystemUiVisibility(); | |
| int newUiOptions = uiOptions; | |
| boolean isImmersiveModeEnabled = | |
| ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions); | |
| if (isImmersiveModeEnabled) { | |
| Log.i(TAG, "Turning immersive mode mode off. "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Utility method to convert a byte array to a hexadecimal string. | |
| * | |
| * @param bytes Bytes to convert | |
| * @return String, containing hexadecimal representation. | |
| */ | |
| public static String ByteArrayToHexString(byte[] bytes) { | |
| final char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; | |
| char[] hexChars = new char[bytes.length * 2]; // Each byte has two hex characters (nibbles) | |
| int v; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Edited by mythou | |
| //http://www.cnblogs.com/mythou/ | |
| //要转换的地址或字符串,可以是中文 | |
| public void createQRImage(String url) | |
| { | |
| try | |
| { | |
| //判断URL合法性 | |
| if (url == null || "".equals(url) || url.length() < 1) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hunt.androidtext; | |
| import android.media.AudioFormat; | |
| import android.media.AudioRecord; | |
| import android.media.MediaRecorder; | |
| import android.os.Handler; | |
| import android.os.Message; | |
| import android.util.Log; | |
| /** |