This file contains 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 String GetCharset(File file) { | |
String charset = "GBK"; | |
byte[] first3Bytes = new byte[3]; | |
try { | |
boolean checked = false; | |
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file)); | |
bis.mark(0); | |
int read = bis.read(first3Bytes, 0, 3); | |
if (read == -1) | |
return charset; |
This file contains 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 static Bitmap convertToBlur(Bitmap bmp) { | |
// 高斯矩阵 | |
int[] gauss = new int[] { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; | |
int width = bmp.getWidth(); | |
int height = bmp.getHeight(); | |
Bitmap newBmp = Bitmap.createBitmap(width, height, | |
Bitmap.Config.RGB_565); | |
int pixR = 0; |
This file contains 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
private void initScreenPixels() | |
{ | |
DisplayMetrics dMetrics = new DisplayMetrics(); | |
WindowManager windowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE); | |
Display display = windowManager.getDefaultDisplay(); | |
display.getMetrics(dMetrics); | |
ScreenWidth = dMetrics.widthPixels; | |
ScreenHeight = dMetrics.heightPixels; |
This file contains 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
Shader shader = new LinearGradient(0, 0, 0, 100, Color.BLUE, Color.GREEN, Shader.TileMode.REPEAT); | |
textView.getPaint().setShader(shader); |
This file contains 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
PowerManager pm = (PowerManager)mContext.getSystemService(Context.POWER_SERVICE); | |
pm.goToSleep(SystemClock.uptimeMillis()); |
This file contains 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
$su | |
#setprop service.adb.tcp.port 5555 | |
#stop adbd | |
#start adbd |
NewerOlder