摘要: 原文:http://developer.android.com/guide/topics/graphics/2d-graphics.html知识点小节:http://www.cnblogs.com/jsaint/articles/3428014.htmlCanvasandDrawablesAndroidframework(框架)Apis提供了一系列的2D画图Apis,通过这些Api你可以指定你自己制定的图片在canvas上或者是修改已存在的views定制它们的外形与视觉感受。当在画2d图像的时候,你通常会在二者之中选其一:a.画你的图像或者是动画在你layout的中某个View对象。这种方式, 阅读全文
posted @ 2013-11-17 12:51 Jsaint 阅读(324) 评论(0) 推荐(0)
摘要: 有效在WebView中设置cookie: CookieSyncManager.createInstance(mWebView.getContext()); CookieManager cookieManager = CookieManager.getInstance(); //如果使用cookie.setCookie(DOMAIN,String.format("version=%s; domain=%s",mApp.getVersionCode,DOMAIN)) //在某些机型上getCookie会返回null c... 阅读全文
posted @ 2013-11-15 11:37 Jsaint 阅读(1704) 评论(0) 推荐(0)
摘要: TimeZone本初子午线(经线0度 英国伦敦格林威治)国际换日线 (经线180度)GMT(格林威治标准时间) Greenwich Mean TimeUTC(世界协调时间) Coordinated UniversalTimeDST(夏日节约时间) Daylight Saving TimeGMT格林威治标准时间,没啥好说的UTCCoordinated UniversalTime-世界协调时间,是经过平均太阳时(以格林威治时间GMT为准)、地轴运动修正后的新时标以及以秒为单位的国际原子时所综合精算而成的.UTC比GMT来的更加精准,其误差在0.9秒以内。一般来说GMT与UTC的功能精确度是没有差别 阅读全文
posted @ 2013-11-15 11:28 Jsaint 阅读(2286) 评论(0) 推荐(0)
摘要: 原文链接:http://developer.android.com/guide/components/fundamentals.htmlApplicationFundamentals(应用基本原则)Androidapp使用java语言编写。Androidsdktools编译代码连同数据与资源文件,形成一个以.apk为后缀的androidpacckage最终文件。所有代码在单独.apk文件中被认为是一个独立的application且android-powered设备使用该文件安装application.一旦被安装在一台设备中,每一个android-app存活在自己独立安全沙盒(securitys 阅读全文
posted @ 2013-10-28 21:23 Jsaint 阅读(592) 评论(0) 推荐(0)
摘要: java 实现多线程两种方式 1.继承threaa类 2.实现runnable 接口thread其实是runnable的一种实现通过调用thread.start(),会通过jvm找到run()方法,启动runable 好处 避免点继承的局限,一个类可以继承多个接口thread code:public static void main(String[] args) { MyThread thread1 = new MyThread("thread one"); MyThread thread2 = new MyThread("thread two"); . 阅读全文
posted @ 2013-10-24 19:30 Jsaint 阅读(118) 评论(0) 推荐(0)
摘要: CountDownLatch类是一个同步计数器,构造时传入int参数,该参数就是计数器的初始值,每调用一次countDown()方法,计数器减1,计数器大于0 时,await()方法会阻塞程序继续执行。CountDownLatch可以看作是一个倒计数的锁存器,当计数减至0时触发特定的事件。利用这种特性,可以让主线程等待子线程的结束使用场景:有一个任务想要往下执行,但必须要等到其他的任务执行完毕后才可以继续往下执行。 1 public class CountDownLatchDemo { 2 final static SimpleDateFormat sdf=new SimpleDate... 阅读全文
posted @ 2013-10-17 19:58 Jsaint 阅读(162) 评论(0) 推荐(0)
摘要: 1.什么是exceptions: 契约精神:简单说api调用者传入约定范围内的参数,api返回约定相应的数值或做相应的操作 两个约定:分别可以称之为前置条件与后置条件e.g: String str = "12345" try { str.charAt(-1); str.charAt(2); } catch (Exception e){ e.printTrack() } 上例中,约定范围内的参数应该是0,1,2,3,4(str.lenth() - 1) 传入参数为-1时,不在约定范围内,违反了前置条件 str... 阅读全文
posted @ 2013-10-17 19:35 Jsaint 阅读(138) 评论(0) 推荐(0)
摘要: The other component type, content provider, is not activated by intents. Rather, it is activated when targeted by a request from aContentResolver. The content resolver handles all direct transactions with the content provider so that the component that's performing transactions with the provider 阅读全文
posted @ 2013-10-06 16:22 Jsaint 阅读(277) 评论(0) 推荐(0)
摘要: mark 纪念一下 阅读全文
posted @ 2013-10-06 15:38 Jsaint 阅读(104) 评论(0) 推荐(0)