上一页 1 2 3 4 5 6 7 8 9 ··· 14 下一页
摘要: 1)使用HttpClient发送GET请求 2)使用HttpClient发送POST请求 HttpClient抓数据示例(教务系统数据抓取) HttpClient可以通过下述代码获取与设置Cookie: HttpResponse loginResponse = new DefaultHttpClie 阅读全文
posted @ 2017-07-03 10:30 yl007 阅读(2128) 评论(0) 推荐(0) 编辑
摘要: 创建一个URL对象: URL url = new URL(http://www.baidu.com); 调用URL对象的openConnection( )来获取HttpURLConnection对象实例: HttpURLConnection conn = (HttpURLConnection) ur 阅读全文
posted @ 2017-07-03 10:20 yl007 阅读(2596) 评论(0) 推荐(0) 编辑
摘要: public class StreamTool { //从流中读取数据 public static byte[] read(InputStream inStream) throws Exception{ ByteArrayOutputStream outStream = new ByteArrayOutputStream(); byte[] buf... 阅读全文
posted @ 2017-07-03 10:07 yl007 阅读(610) 评论(0) 推荐(0) 编辑
摘要: public class SPUtils { /** * 保存在手机里的SP文件名 */ public static final String FILE_NAME = "my_sp"; /** * 保存数据 */ public static void put(Context context, String key, Obj... 阅读全文
posted @ 2017-06-30 16:13 yl007 阅读(438) 评论(0) 推荐(0) 编辑
摘要: public class MD5 { public static String getMD5(String content) { try { MessageDigest digest = MessageDigest.getInstance("MD5"); digest.update(content.getBytes()); ... 阅读全文
posted @ 2017-06-30 16:12 yl007 阅读(142) 评论(0) 推荐(0) 编辑
摘要: public abstract class MyAdapter extends BaseAdapter { private ArrayList mData; private int mLayoutRes; //布局id public MyAdapter() { } public MyAdapter(ArrayList mData... 阅读全文
posted @ 2017-06-28 11:01 yl007 阅读(200) 评论(0) 推荐(0) 编辑
摘要: public class SPUtils { /** * 保存在手机里的SP文件名 */ public static final String FILE_NAME = "my_sp"; /** * 保存数据 */ public static void put(Context context, String key, Obj... 阅读全文
posted @ 2017-06-21 22:27 yl007 阅读(188) 评论(0) 推荐(0) 编辑
摘要: public class MD5 { public static String getMD5(String content) { try { MessageDigest digest = MessageDigest.getInstance("MD5"); digest.update(content.getBytes()); ... 阅读全文
posted @ 2017-06-21 22:26 yl007 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 接口的意义:规范、扩展、回调。 抽象类的意义:封装子类中重复内容定义成抽象方法,子类虽有不同方法,但是定义是一样的。 抽象类和接口的区别: 1、默认的方法实现:抽象类可以有默认的方法实现完全是抽象的。接口根本不存在方法的实现。 2、实现:子类使用extends关键字来继承抽象类。如果子类不是抽象类的 阅读全文
posted @ 2017-06-07 16:52 yl007 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 定义:策略模式定义了一系列的算法,并将每一个算法封装起来,而且使它们还可以相互替换。策略模式让算法独立于使用它的客户而独立变化。 策略模式主要用来分离算法,根据相同的行为抽象来做不同的具体策略实现 策略:它定义了算法家庭,分别封装起来。让它们之间可以互相替换,此模式让算法的变化,不会影响到使用算法的 阅读全文
posted @ 2017-06-06 16:45 yl007 阅读(171) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 14 下一页