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 |
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
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
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
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
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
MovieBannerView.clearAnimation(); | |
TranslateAnimation TransAnim; | |
TransAnim = new TranslateAnimation(0.0f, 0.0f, banner_h, 0.0f); | |
TransAnim.setDuration(bannerAnimTime); | |
MovieBannerView.startAnimation(TransAnim); |
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
/**解析音乐标签 | |
* 测试发现无法解析wma音乐文件 | |
* 可解析mp3 ma4等 | |
* Created by junny on 12/17/13. | |
*/ | |
public class MusicParseUtil { | |
public static String getAlbum(String filePath){ | |
String album; |
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
要特别注意的是,dialog.show(),一定要放在dialog.setContentView()的前面 |
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
/** | |
* 文件大小格式转换 | |
* @param fileS 文件大小 | |
* @return 文件大小 | |
*/ | |
public static String FormatFileSize(long fileS) | |
{ | |
// 转换文件大小 | |
DecimalFormat df = new DecimalFormat("#.00"); | |
String fileSizeString = ""; |
OlderNewer