Time of Update: 2015-06-06
android 下拉重新整理,android下拉1、github 原作者: https://github.com/chrisbanes/Android-PullToRefresh 我自己的: https:/
Time of Update: 2015-06-06
Android-理解IntentService,intentservice1.先來瞭解下什麼是IntentService,intentService是繼承Service的抽象類別,我們知道Service本身是不會開啟新線程的,如要則需要在onStartCommand中建立Thread.那麼IntentService,我們來看一下他的onCreate方法.我們知道,android是用handler來實現其他線程和主線程的通訊的,handler顧名思義就是一個投遞者,我們可以把它理解成快遞員,在其他
Time of Update: 2015-06-06
Android-Service中執行新線程的幾種方式,androidservice線程大家都知道,service和activity都是運行在UI線程中,逾時的資料讀取和網路耗時等操作必須建立線程,下面說說service中執行新線程的幾種方式。1.傳統的java方式我們都知道 java中建立線程可以繼承Thread類,也可以implement
Time of Update: 2015-06-06
全面介紹Android的MVVM架構 - 資料繫結原文地址 MasteringAndroidDataBinding本教程是跟著 Data Binding Guide 學習過程中得出的一些實踐經驗,同時修改了官方教程的一些錯誤,每一個知識點都有對應的源碼,爭取做到實踐與理論相結合。Data Binding 解決了 Android UI 編程中的一個痛點,官方原生支援 MVVM
Time of Update: 2015-06-06
自訂View實現Android圓形進度條,支援自訂顯示的樣式我是完全根據這裡仿製了一個作為備忘,可以點擊這裡查看原始版本代碼如下:1、res/values/attrs.xml 2、具體實現 public class RoundProgressBar extends View {private Paint mPaint;private int mRoundColor;private int mProgressColor;private int mTextColor;
Time of Update: 2015-06-06
Android設計模式--Factory 方法模式1、定義:Define an interface for creating an object, but let subclasses decide which class to instantiate.Factory Method lets a class defer instantiation to subclasses.定義一個用於建立對象的介面,讓子類決定執行個體化哪個類。 2、意義:Factory
Time of Update: 2015-06-06
Android RxJava使用介紹(二)
Time of Update: 2015-06-06
Android Fragment 簡單一實例 Android上的介面展示都是通過Activity實現的,Activity實在是太常用了,我相信大家都已經非常熟悉了,這裡就不再贅述。
Time of Update: 2015-06-06
andorid 自訂SwitchButton因項目緣故需重新定製SwitchButton,效果如下: 過程如下:1.圓角矩形的繪製2.字型繪製3.小圓繪製4.左右滑動動畫效果繪製代碼如下: package com.smart.view;import java.util.Timer;import java.util.TimerTask;import android.annotation.SuppressLint;import android.content.Context;import
Time of Update: 2015-06-06
Android 擷取螢幕資訊 擷取螢幕資訊:狀態列高度、content大小 public void getScreenInfo(final Activity activity){ final View v = activity.getWindow().findViewById(Window.ID_ANDROID_CONTENT); v.getViewTreeObserver().addOnPreDrawListener(new
Time of Update: 2015-06-06
Android添加新的視頻格式--媒體庫掃描需求:在mediaprovider資料庫中添加.mov尾碼格式的視頻檔案可以使用工具MediaInfo_GUI_0.7.67_Windows.3243836749.exe 查看mov檔案編碼格式類型,可以到http://download.csdn.net/detail/deng0zhaotai/8767089下載。 概要完整名稱 : D:好歌曲學員合.mov檔案格式
Time of Update: 2015-06-06
android裡單例對象和某些資料被釋放的問題接觸正式的android開發已經有一段時間了,項目的第一個版本終於快完成了。有一次自己在測試的時候,把自己的android項目切到後台,同時開啟了幾個應用之後重新切回到自己的app,發現報錯了。經過排查,發現是自己的單例對象中的資料被釋放掉了,也就是int變數的值 變成了0,string變數的值變成了null。我的單例一開始是這樣的(舉例); public class UserInfo {private static UserInfo
Time of Update: 2015-06-06
Android九宮格解鎖的實現示範效果如下主要代碼如下布局檔案如下: 從布局檔案中可以看出需要自訂一個View用於繪製九宮格圖案:SudokuView.javapackage com.xuliugen.jiugongge;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import
Time of Update: 2015-06-06
Android的xml/assets/raw資源使用詳解一、assets/xml/raw資源介紹
Time of Update: 2015-06-06
android——如何理解控制項的寬高及layout_grivaty與grivaty的區別關於Layout_width/height引發的寬高思考方式一: 結果不符合預期。運行結果: 方式二: 結果符合預期。如: Android控制項寬高的規則:Android下的控制項預設沒有寬高,是由父控制項給其寬高的。其中一般的view控制項是由(ViewGroup控制項:LinearLayout、Relat
Time of Update: 2015-06-06
Android之Http通訊——4.Android HTTP請求方式:HttpClient本節引言:上節講了HttpURLConnection,本節就到HttpClient了,Apache給我們提供的HttpClient(簡單的Http用戶端),不過畢竟不是親兒子,HttpClient在API
Time of Update: 2015-06-06
Android - 5分鐘發布Android Library項目到JCenterandroid-library-publish-to-jcenter是一個協助Android開發人員將AAR庫發布到jcenter的項目,android-library-publish-to-jcenter已經將需要寫的指令碼封裝好了,我們只需要配置相關屬性即可在5分鐘之內發布我們的項目到JCenter(不包括審核時間哦)1. 註冊Bintray帳號
Time of Update: 2015-06-05
Android整機源碼如何輕鬆下載?清華大學Android源碼鏡像,android源碼今天發現,清華大學提供AOSP鏡像,以前都是從Google的網站下載同步更新的,但是現在有了國內的鏡像網站就好多了協助:https://wiki.tuna.tsinghua.edu.cn/MirrorUsage/android倉庫地址:git://aosp.tuna.tsinghua.edu.cn/android/使用瀏覽器訪問:http://aosp.tuna.tsinghua.edu.cn/android/
Time of Update: 2015-06-05
android中各種顏色在drawable.xml的值,androiddrawablexml< drawable name="white">#FFFFFF< /drawable>< !--白色 -->< drawable name="black">#000000< /drawable>< !--黑色 -->< drawable name="ivory">
Time of Update: 2015-06-05
Android:使用ZXing產生二維碼(支援添加Logo圖案),androidzxingZXing是Google的一個開源庫,可以用來產生二維碼、掃描二維碼。本文所介紹的是第一部分。首先上:ZXing相關各種檔案官方:https://github.com/zxing/zxing/releases 或者在這裡下載(只有本項目所用的jar包,版本號碼:3.2.0):連結: http://pan.baidu.com/s/1hq3s5EW 密碼: mvg71.產生二維碼的工具類/** *