原创 asyncTask基礎

asyncTask的參數 Params 在執行 AsyncTask 時需要傳入的參數,可用於在後臺任務中使用。 Progress 後臺任務執行時,如果需要在界面上顯示當前的進度,則使用這裏指定的泛型作爲 進度單位。 Resu

原创 mac 蘋果電腦的睡眠與休眠,決待機耗電的問題,AddressBookSourceSync

前一陣電腦關上蓋子任然很費電,於是調查一下, 方法1 查看自己電腦的休眠狀態,改成25可以解決待機耗電的問題 pmset -g 以下是蘋果電腦的幾種休眠狀態, hibernatemode=0 by default is suppo

原创 使用Jekyll now 30秒快速建站

打開jelly now的github,然後fork到自己的github上 Jekyll now的地址如下:https://github.com/barryclark/jekyll-now fork按鈕在屏幕的右上角 然後在

原创 初學者常見錯誤,android的多線程更新UI

android的多線程 方法1 class MyThread extends Thread {} new MyThread().start(); 方法2 class MyThread implements Runnable {}

原创 android的service基礎

service繼承於service public class MyService extends Service { @Override public IBinder onBind(Intent intent) {

原创 使用WiFIManager自動連接指定Wifi

定義連接方法的class open WiFi configure WiFi connet WiFi public class WifiAdmin { // 定義WifiManager對象 private Wif

原创 ContentResolver和ContentProvider的關係

ContentProvider負責 組織應用程序的數據; 向其他應用程序提供數據; ContentResolver則負責 獲取ContentProvider提供的數據; 修改/添加/刪除更新數據等; ContentProv

原创 android的四大存儲之一 SharedPreferences

SharedPreferences的基本概念: 文件保存路徑:/data/data/<包名>/shared_prefs目錄下目錄下生成了一個SP.xml文件 SharedPreferences的存儲修改是通過Editor對象實現

原创 JAVA複習(不定期更新)

java中的小問號 if (a == b) { do(a); } else { do(b); } 相當於 (a == b) ? do(a) : do(b); 關係 Inheritance 繼承 Agg

原创 android使用butterknife InjectView和BindView

Butter Knife 是一個專注於 Android 系統 View 的注入框架, 讓你從煩人的 findViewById 中解脫出來。同時還支持 View 的一些事件處理函數。 butterknife地址:https://

原创 android test review

Which of the following is not Content Provider? answer: Shared Preferences Android系統一共提供了四種數據存儲方式。分別是:SharePrefere

原创 content Provider

使用內容提供器是 Android 實現跨程序共享數據的標準方式。 實現各個應用程序之間的(跨應用)數據共享, ContentProvider是怎麼實現數據共享的呢? (1) URI URI:統一資源標識符,代表要操作的數據

原创 使用com.lorentzos.swipecards創建Tantan探探,tinder般的翻卡片效果

效果是這個樣子滴 導入方法 首先在Gradle中添加一下代碼 dependencies { compile 'com.lorentzos.swipecards:library:X.X.X@aar' } 在acti

原创 android的fragment

採用fragment而不是activity進行應用的UI管理,可繞開Android系統activity規則的限制。 1.使用佈局fragment 這種方式雖然簡單但靈活性不夠。 添加fragment到activity佈局中,就等

原创 android GCM(消息推送)面向國內開發的話基本不用看了

GCM(Google Cloud Message for Android) Google發佈的Android服務器推送(push)技術。 之前的C2DM(Android Cloud to Device Messaging)已與2