共 94 篇文章 |
|
如何定位Android NDK开发中遇到的错误 Android NDK是什么,为什么我们要用NDK?如果你看过logcat打印的NDK错误时的日志就会知道,我省略了后面很多的内容,很多人看到这么多密密麻麻的日志就已经头晕脑胀了,即使是很多资深的Android开发者,在面对NDK日志时也大都默默的选择了无视。这个命令行工具包含在NDK工具的安装目录,和ndk-build和其他... 阅79 转0 评0 公众公开 15-03-18 19:41 |
Android笔记:bitmap转换与处理相关工具类,Bitmap与DrawAble与byte[]与InputStream之间的转换 // 按大小缩放。Bitmap bitmap = BitmapFactory.decodeFile(srcPath, newOpts);Bitmap bitmap = BitmapFactory.decodeStream(isBm, null , null );private static Bitmap comp(Bitmap image) {Bitmap bitmap = BitmapFactory.decodeStream(isB... 阅61 转0 评0 公众公开 15-03-18 19:09 |
Android Bitmap与DrawAble与byte[]与InputStream之间的转换工具类。Bitmap;public InputStream Bitmap2InputStream(Bitmap bm) {public InputStream Bitmap2InputStream(Bitmap bm, int quality) {public Bitmap InputStream2Bitmap(InputStream is) {Bitmap bitmap = this.drawable2Bitmap(d);public Bitmap drawable2Bitmap(Drawable drawabl... 阅42 转1 评0 公众公开 15-03-18 18:58 |
在线程的内部有一个或多个Handler对象,外部程序通过该handler对象向线程发送异步消息,消息经由Handler传递到MessageQueue对象中。从上述的代码可以看到,一个线程只允许创建一个Looper对象,这是因为每个Looper对象都会创建一个MessageQueue对象,一个异步线程中只能有一个消息队列,所以也就只能有一个Looper对象。程序员一般使用Handler类... 阅114 转1 评0 公众公开 15-03-18 18:40 |
阅42 转0 评0 公众公开 15-03-18 14:53 |
MessageDigest mdTemp3= MessageDigest.public String md5sumWithEncoder(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException{ /*确定计算方法*/ MessageDigest md5=MessageDigest.getInstance("MD5"); BASE64Encoder base64en = new BASE64Encoder(); /*加密后的散列码字符串*/ Stri... 阅84 转0 评0 公众公开 15-03-18 14:44 |
1 public static Bitmap zoomBitmap(Bitmap bitmap, int width, int height) { 2 int w = bitmap.getWidth();8 Bitmap newbmp = Bitmap.createBitmap(bitmap, 0, 0, w, h, matrix, true);1 public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, float roundPx) { 2 int w = bitmap.getWidth();1 public static Bitmap createReflection... 阅28 转0 评0 公众公开 15-03-18 11:57 |
This Handler class should be static or leaks might occur Android. 阅240 转0 评0 公众公开 15-03-18 11:28 |
Android线程间通信机制 Android线程间通信机制。当android应用程序运行时,一个主线程被创建(也称作UI线程),此线程主要负责处理UI相关的事件,由于Android采用UI单线程模型,所以只能在主线程中对UI元素进行操作,如果在非UI线程直接对UI进行了操作,则会报错,另外,对于运算量较大的操作和IO操作,我们需要新开线程来处理这些工作,以免阻塞... 阅9 转0 评0 公众公开 15-03-17 20:15 |
基于Android中实现定时器的3种解决方法 在Android开发中,定时器一般有以下3种实现方法:一、采用Handler与线程的sleep(long)方法二、采用Handler的postDelayed(Runnable, long)方法三、采用Handler与timer及TimerTask结合的方法下面逐一介绍:一、采用Handle与线程的sleep(long)方法Handler主要用来处理接受到的消息。 阅28 转0 评0 公众公开 15-03-17 19:25 |