編輯:關於 Android 程式設計
在 Android 中使用測試框架,關鍵步驟主要有兩個。
讓你的測試類別繼承 AndroidTestCase,並以 test 開頭的方法撰寫測試案例:
package com.njupt.junittest;
import android.test.AndroidTestCase;
public class MyTest extends AndroidTestCase {
public void test1() {
System.out.println("我愛章澤天...");
}
}
需要在 manifest 節點下配置 instrumentation,並在 application 節點下配置 uses-library:
完成這兩個步驟後,即可透過 InstrumentationTestRunner 執行測試,驗證應用程式的行為是否符合預期。
用屬性動畫實現布局的下拉展開與收起效果
從 Android 3.0 開始,Google 引入了屬性動畫(Property Animation)框架,讓我們能做出更豐富、更可控的動畫,於是趁這個需求聊一下。 需求
Android AttributeSet 介面詳解:XML 屬性集合的讀取方式
AttributeSet 是 android.util.AttributeSet 介面,已知間接的子類別為 XmlResourceParser。凡是自定義過 View 的
Android 動態高斯模糊效果教程(RenderScript 實現)
寫在前面最近在準備畢設,考慮到可能用到模糊效果,於是學習了高斯模糊的實現。較有名的方案是 FastBlur 及其衍生優化版,還有你可能聽過的 RenderScript。不
Android 透過 Notification 與 NotificationManager 實作訊息通知
Notification 是一種讓你的應用程式在後台運行或未被開啟時,仍能提醒使用者有事件需要注意的機制。對於那些看不見的程式元件(BroadcastReceiver、S