首页 文章 精选 留言 我的

精选列表

搜索[Android],共10000篇文章
优秀的个人博客,低调大师

Android系统小知识

1.添加振动 http://blog.csdn.net/caesardadi/article/details/8251933 2.excel操作 jxl.jar jxcell.jar Appache的poi库 3.保证屏幕黑屏之后CPU继续运作 http://blog.csdn.net/jhope/article/details/53737402 4.文件新建之后,在电脑上看不见。 http://blog.csdn.net/lmw21848/article/details/52297346 5.java文件加解密 http://zhangzhaoaaa.iteye.com/blog/2124700 6.AlarmManager定点提醒 http://blog.csdn.net/fxdaniel/article/details/41150129 几个设置参数的意义 http://blog.csdn.net/wangjia55/article/details/21518931 7. 本文转自屠夫章哥 51CTO博客,原文链接:http://blog.51cto.com/4259297/2048586,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android SQLite数据存储

今天给大家演示如何使用SQLite数据库实现数据存储,见图: 1:UI布局功能代码layout/main.xml 2:UI布局值对应代码values/string.xml 3:功能实现主要实现类SQLiteActivity.java,DatabaseHelper.java 4:创建SQLiteOpenHelper帮助类,用来管理数据库 今天就写到这里了,实在是太累了,希望大家多多支持 本文转自 Art_Hero 51CTO博客,原文链接:http://blog.51cto.com/curran/506938,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android实现ListView(2)

在上一篇我们以SimpleAdapter实现ListView,这一篇以上一篇为基础,以BaseAdapter实现ListView,我们添加一个按钮,见图: 1:UI布局,创建item布局layout/item.xml 3:创建一个ListViewActivity类,但是必须继承ListActivity,具体见代码: 到此功能就实现了,UI布局有点不美观,不讲究了,大家能看懂就好了 本文转自 Art_Hero 51CTO博客,原文链接:http://blog.51cto.com/curran/508911,如需转载请自行联系原作者

优秀的个人博客,低调大师

android 处理图片工具

packagecom.wireme.activity; importjava.io.ByteArrayOutputStream; importjava.io.File; importjava.io.FileNotFoundException; importjava.io.FileOutputStream; importjava.io.IOException; importandroid.graphics.Bitmap; importandroid.graphics.BitmapFactory; importandroid.graphics.Canvas; importandroid.graphics.ColorMatrix; importandroid.graphics.ColorMatrixColorFilter; importandroid.graphics.Paint; importandroid.graphics.PorterDuffXfermode; importandroid.graphics.Rect; importandroid.graphics.RectF; importandroid.graphics.Bitmap.Config; importandroid.graphics.PorterDuff.Mode; importandroid.graphics.drawable.BitmapDrawable; importandroid.graphics.drawable.Drawable; /* * *处理图片的工具类. */ public classimageTool{ public staticfinal intLEFT= 0; public staticfinal intRIGHT= 1; public staticfinal intTOP= 3; public staticfinal intBOTTOM= 4; /* * */ /* * *图片去色,返回灰度图片 * *@parambmpOriginal *传入的图片 *@return去色后的图片 */ public staticBitmaptoGrayscale(BitmapbmpOriginal){ intwidth,height; height=bmpOriginal.getHeight(); width=bmpOriginal.getWidth(); BitmapbmpGrayscale=Bitmap.createBitmap(width,height, Bitmap.Config.RGB_565); Canvasc= newCanvas(bmpGrayscale); Paintpaint= newPaint(); ColorMatrixcm= newColorMatrix(); cm.setSaturation( 0); ColorMatrixColorFilterf= newColorMatrixColorFilter(cm); paint.setColorFilter(f); c.drawBitmap(bmpOriginal, 0, 0,paint); returnbmpGrayscale; } /* * */ /* * *去色同时加圆角 * *@parambmpOriginal *原图 *@parampixels *圆角弧度 *@return修改后的图片 */ public staticBitmaptoGrayscale(BitmapbmpOriginal, intpixels){ returntoRoundCorner(toGrayscale(bmpOriginal),pixels); } /* * */ /* * *把图片变成圆角 * *@parambitmap *需要修改的图片 *@parampixels *圆角的弧度 *@return圆角图片 */ public staticBitmaptoRoundCorner(Bitmapbitmap, intpixels){ Bitmapoutput=Bitmap.createBitmap(bitmap.getWidth(),bitmap .getHeight(),Config.ARGB_8888); Canvascanvas= newCanvas(output); final intcolor= 0xff424242; finalPaintpaint= newPaint(); finalRectrect= newRect( 0, 0,bitmap.getWidth(),bitmap.getHeight()); finalRectFrectF= newRectF(rect); final floatroundPx=pixels; paint.setAntiAlias( true); canvas.drawARGB( 0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF,roundPx,roundPx,paint); paint.setXfermode( newPorterDuffXfermode(Mode.SRC_IN)); canvas.drawBitmap(bitmap,rect,rect,paint); returnoutput; } /* * */ /* * *使圆角功能支持BitampDrawable * *@parambitmapDrawable *@parampixels *@return */ public staticBitmapDrawabletoRoundCorner(BitmapDrawablebitmapDrawable, intpixels){ Bitmapbitmap=bitmapDrawable.getBitmap(); bitmapDrawable= newBitmapDrawable(toRoundCorner(bitmap,pixels)); returnbitmapDrawable; } /* * *读取路径中的图片,然后将其转化为缩放后的bitmap * *@parampath */ public static voidsaveBefore(Stringpath){ BitmapFactory.Optionsoptions= newBitmapFactory.Options(); options.inJustDecodeBounds= true; // 获取这个图片的宽和高 Bitmapbitmap=BitmapFactory.decodeFile(path,options); // 此时返回bm为空 options.inJustDecodeBounds= false; // 计算缩放比 intbe=( int)(options.outHeight/( float) 200); if(be<= 0) be= 1; options.inSampleSize= 2; // 图片长宽各缩小二分之一 // 重新读入图片,注意这次要把options.inJustDecodeBounds设为false哦 bitmap=BitmapFactory.decodeFile(path,options); intw=bitmap.getWidth(); inth=bitmap.getHeight(); System. out.println(w+ " "+h); // savePNG_After(bitmap,path); saveJPGE_After(bitmap,path); } /* * *保存图片为PNG * *@parambitmap *@paramname */ public static voidsavePNG_After(Bitmapbitmap,Stringname){ Filefile= newFile(name); try{ FileOutputStream out= newFileOutputStream(file); if(bitmap.compress(Bitmap.CompressFormat.PNG, 100, out)){ out.flush(); out.close(); } } catch(FileNotFoundExceptione){ e.printStackTrace(); } catch(IOExceptione){ e.printStackTrace(); } } /* * *保存图片为JPEG * *@parambitmap *@parampath */ public static voidsaveJPGE_After(Bitmapbitmap,Stringpath){ Filefile= newFile(path); try{ FileOutputStream out= newFileOutputStream(file); if(bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out)){ out.flush(); out.close(); } } catch(FileNotFoundExceptione){ e.printStackTrace(); } catch(IOExceptione){ e.printStackTrace(); } } /* * *水印 * *@parambitmap *@return */ public staticBitmapcreateBitmapForWatermark(Bitmapsrc,Bitmapwatermark){ if(src== null){ return null; } intw=src.getWidth(); inth=src.getHeight(); intww=watermark.getWidth(); intwh=watermark.getHeight(); // createthenewblankbitmap Bitmapnewb=Bitmap.createBitmap(w,h,Config.ARGB_8888); // 创建一个新的和SRC长度宽度一样的位图 Canvascv= newCanvas(newb); // drawsrcinto cv.drawBitmap(src, 0, 0, null); // 在0,0坐标开始画入src // drawwatermarkinto cv.drawBitmap(watermark,w-ww+ 5,h-wh+ 5, null); // 在src的右下角画入水印 // saveallclip cv.save(Canvas.ALL_SAVE_FLAG); // 保存 // store cv.restore(); // 存储 returnnewb; } /* * *图片合成 * *@return */ public staticBitmappotoMix( intdirection,Bitmap...bitmaps){ if(bitmaps.length<= 0){ return null; } if(bitmaps.length== 1){ returnbitmaps[ 0]; } BitmapnewBitmap=bitmaps[ 0]; // newBitmap=createBitmapForFotoMix(bitmaps[0],bitmaps[1],direction); for( inti= 1;i<bitmaps.length;i++){ newBitmap=createBitmapForFotoMix(newBitmap,bitmaps[i],direction); } returnnewBitmap; } private staticBitmapcreateBitmapForFotoMix(Bitmapfirst,Bitmapsecond, intdirection){ if(first== null){ return null; } if(second== null){ returnfirst; } intfw=first.getWidth(); intfh=first.getHeight(); intsw=second.getWidth(); intsh=second.getHeight(); BitmapnewBitmap= null; if(direction==LEFT){ newBitmap=Bitmap.createBitmap(fw+sw,fh>sh?fh:sh, Config.ARGB_8888); Canvascanvas= newCanvas(newBitmap); canvas.drawBitmap(first,sw, 0, null); canvas.drawBitmap(second, 0, 0, null); } else if(direction==RIGHT){ newBitmap=Bitmap.createBitmap(fw+sw,fh>sh?fh:sh, Config.ARGB_8888); Canvascanvas= newCanvas(newBitmap); canvas.drawBitmap(first, 0, 0, null); canvas.drawBitmap(second,fw, 0, null); } else if(direction==TOP){ newBitmap=Bitmap.createBitmap(sw>fw?sw:fw,fh+sh, Config.ARGB_8888); Canvascanvas= newCanvas(newBitmap); canvas.drawBitmap(first, 0,sh, null); canvas.drawBitmap(second, 0, 0, null); } else if(direction==BOTTOM){ newBitmap=Bitmap.createBitmap(sw>fw?sw:fw,fh+sh, Config.ARGB_8888); Canvascanvas= newCanvas(newBitmap); canvas.drawBitmap(first, 0, 0, null); canvas.drawBitmap(second, 0,fh, null); } returnnewBitmap; } /* * *将Bitmap转换成指定大小 * *@parambitmap *@paramwidth *@paramheight *@return */ public staticBitmapcreateBitmapBySize(Bitmapbitmap, intwidth, intheight){ returnBitmap.createScaledBitmap(bitmap,width,height, true); } /* * *Drawable转Bitmap * *@paramdrawable *@return */ public staticBitmapdrawableToBitmapByBD(Drawabledrawable){ BitmapDrawablebitmapDrawable=(BitmapDrawable)drawable; returnbitmapDrawable.getBitmap(); } /* * *Bitmap转Drawable * *@parambitmap *@return */ public staticDrawablebitmapToDrawableByBD(Bitmapbitmap){ Drawabledrawable= newBitmapDrawable(bitmap); returndrawable; } /* * *byte[]转bitmap * *@paramb *@return */ public staticBitmapbytesToBimap( byte[]b){ if(b.length!= 0){ returnBitmapFactory.decodeByteArray(b, 0,b.length); } else{ return null; } } /* * *bitmap转byte[] * *@parambm *@return */ public static byte[]bitmapToBytes(Bitmapbm){ ByteArrayOutputStreambaos= newByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100,baos); returnbaos.toByteArray(); } } 本文转自 terry_龙 51CTO博客,原文链接:http://blog.51cto.com/terryblog/791516 ,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册