摘要: 也是直接上代码吧=。= 1 package cn.itcast.bitmapcopy; 2 3 import java.io.FileNotFoundException; 4 5 import android.app.Activity; 6 import android.content.Intent; 7 import android.graphics.Bitmap; 8 import android.graphics.BitmapFactory; 9 import android.graphics.Canvas;10 import android.graphics.Matrix;11 i.. 阅读全文
posted @ 2013-01-27 13:51 王世桢 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 其实关于照片的大小 像素 拍摄所用的相机,等一系列的信息都在照片的头信息中也是使用android自带的类使用的,直接代码吧 1 package cn.itcast.exit; 2 3 import java.io.IOException; 4 5 import android.app.Activity; 6 import android.media.ExifInterface; 7 import android.os.Bundle; 8 9 public class ExifActivity extends Activity {10 /** Called when the act... 阅读全文
posted @ 2013-01-27 13:14 王世桢 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 也是直接上代码吧 1 package cn.itcast.resizeimage; 2 3 import java.io.FileNotFoundException; 4 import java.io.IOException; 5 import java.io.InputStream; 6 7 import android.app.Activity; 8 import android.content.Intent; 9 import android.graphics.Bitmap;10 import android.graphics.BitmapFactory;11 import andr.. 阅读全文
posted @ 2013-01-27 12:55 王世桢 阅读(680) 评论(0) 推荐(0) 编辑
摘要: 没什么好说的就直接上代码吧 1 public void cropImage(View view){ 2 Intent intent = new Intent(); 3 4 Bundle myExtras = new Bundle(); 5 myExtras.putBoolean("return-data", true); 6 intent.putExtras(myExtras); 7 8 9 intent.setAction("com.android.camera.action... 阅读全文
posted @ 2013-01-27 12:37 王世桢 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 1.在布局文件增加一个按钮布局文件 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="fill_parent" 4 android:layout_height="fill_parent" 5 android:orientation="vert 阅读全文
posted @ 2013-01-27 12:15 王世桢 阅读(278) 评论(0) 推荐(0) 编辑
摘要: Perferenceactivity系统组建可以实现系统设置的窗体,同时省去了我们自己去写配置文件这里面类型很多 下面上代码 自己看效果 自己看下代码就可以懂 很简单首先在res中创建一个文件夹xml,里面建立一个文件setting.xml代表perferenceactivity的关联文件setting.xml 1 <?xml version="1.0" encoding="utf-8"?> 2 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/re 阅读全文
posted @ 2013-01-26 23:28 王世桢 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 1.自定义一个类(MaApp)继承Application2.在清单文件中的Application选项菜单对应的name属性中添加MyApp3.重写application中的onCreate方法4.自定义一个类(MyCrashHandler) 实现UncaughtExceptionHandler实现其中的uncaughtException方法5.将MyCrashHandler 采用单例设计模式 加入同步代码块6.在MyApp类中的主线程把这个异常捕获设置进去1 Thread.currentThread().setUncaughtExceptionHandler(MyCrashHandler.ge 阅读全文
posted @ 2013-01-26 19:35 王世桢 阅读(475) 评论(0) 推荐(0) 编辑
摘要: 本页面主要讲述为单个模块抽取出来的使用方法,如果要多个模块整合在一起可以使用百度Demo里面extendsMapActivity,下面为个人位置的获取并在地图展现的事项1.在配置文件中添加百度地图使用的一些相关权限(请求网络等)1 <!-- 添加百度地图权限 -->2 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>3 <uses-permission android:name="androi 阅读全文
posted @ 2013-01-24 09:27 王世桢 阅读(766) 评论(0) 推荐(0) 编辑
摘要: 使用的是 net.htmlparesr.jericho.Source;包中的Source,需要导入jaricho-html-3.1.jar的外部jar包一下为用这个包解析豆瓣网站的验证码的代码 1 URL url = new URL("http://www.douban.com/accounts/login"); 2 URLConnection conn = url.openConnection(); 3 //得到服务器返回的html连接 转化成的html的对象 4 Source source = new Source(conn... 阅读全文
posted @ 2013-01-23 21:11 王世桢 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 1.布局的背景可以引入一个layout-list.xml代表设置变换的图片,布局上面 中间 结束的颜色不同 1 <?xml version="1.0" encoding="utf-8"?> 2 <layer-list 3 xmlns:android="http://schemas.android.com/apk/res/android"> 4 <item> 5 <shape> 6 <gradient 7 android:startColor="#ffa6a6a6" 阅读全文
posted @ 2013-01-23 21:07 王世桢 阅读(242) 评论(0) 推荐(0) 编辑