input method 調用 ,防止UI界面被輸入法遮擋 ,可以用activity android:windowSoftInputMode="adjustResize"
http://blog.csdn.net/feng88724/archive/2011/02/15/6186037.aspx
testProject
install ultraedit
datastore .
preference ,
Mode , internal ,exterenal , getDir(). exteral mucsic dir .
http://www.devdaily.com/java/jwarehouse/
http://android.bigresource.com
TypeArray , attributeset
TypedArray a =
context.obtainStyledAttributes(
attrs, com.android.internal.R.styleable.TextView, defStyle, 0);
public final TypedArray obtainStyledAttributes(
AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
stylable 裏面的對象比 att 多 ,多的是att 數組,還有重複使用的 att 。
但是值不一樣,stylable 裏面的簡單 01
Git
core/res/res/values/styles.xml System resource
這種就是沒有公開的class,有@hide標誌的。
如果用到這種類,有兩種辦法,
1.把你的應用放在android源碼樹下編譯。可以直接import進來的。
2.把源碼樹中用到的這種類的@hide去掉,重新編譯sdk,在得到的sdk環境下不需要源碼樹也可以編譯你的應用。
用到這種類的應用不保證向後兼容,因爲這些類隨着android版本更新,可能會發生變化或者消失。
http://www.androidjavadoc.com/2.3/index.html
http://json.org/java/
http://www.oschina.net/code/explore/android-2.2-froyo/com/android/internal
permission and intent system define
lost focus validate ,listen lost focuse ,
text change listener
copy 錯誤 ,浪費太多時間,review code
log 信息 ,最好用log d aaa
ComponentName getCallingActivity () ,activity must expecting a result
Activity comunicate ,through message
only kill process ,not activiy,so sometime ,activity will show after kill .( is task data store in system server ?)
but the system can drop it from memory either by asking it to finish (calling its finish() method), or simply killing its process completely restarted and restored to its previous state.
stop the thread in onDestroy().
ondestroy ,可以消除資源,但是對象還在,再次調用時候,他會重新生一個Activity 。老的activity 就無法調用了。
注意性能
所以儘量不要引用到這些對象。
接口方法的調用比實現類方法的調用更耗時
建議使用內部類 ,避免使用枚舉
重用對象
adapter setText 方法 可以set spanText
AnimationView ViewFlipper
alpha out 問題
json 編碼問題 最後還是用笨方法 , 竟然沒有public 公用的方法,只能模擬一個json 對象 。
不過 他是jasonStringer 對象 可以 用toString 方法。
why can not see data
UI debug ,no data ,data has 0 height ,image dose not set bound
is your activity running?
copyBounds ,節省對象?
Drawable 對象 ,有生成子類的靜態方法 ,(應該用個factory )和所有的之類方法(setState ,應該在之類定義)
核心 draw ,setBounds(Rect bounds) ,沒有 回收方法 recycle
Drawable.Callback Implement this interface if you want to create an animated drawable that extends Drawable (起名不合適)
animated duration ,循環 , 動畫在
Bitmap.compress
Bitmap.Config
getPixel(int x, int y)
canvas dispose hold call
getGraphics2d() why eclipse can not found ,可以打開,但是編譯不通過,所以src 和普通的有區別
import java.awt.Graphics2D; 使用了,但是沒有讓user 使用 分工
HttpParams is similar to HttpContext.
ConnManagerParams , all use params and use ConnManagerParams to set value .
用了entity ,但是
ListView
dispatchSaveInstanceState(SparseArray<Parcelable> container) 可以保存狀態
SparseArray here can be gaps in the indices
It is intended to be more efficient than using a HashMap to map Integers to Objects. 爲了性能啊
util 包
ListView header ,headerAdapter
* 設置將內容繪製在mSCBitmap上 */
mCanvas.setBitmap(mSCBitmap);
DataSetObserver observer
mDataSetObservable
CompoundButton
android.widget.ToggleButton ,button property
dialog 爲什麼 不能放中間,最後用relative layout 。
popup windwo 不能變灰,不能讓後面不可touch ,但是可以通過其他方法來設置。還不如用Dialog window 。
popup 最外面設置數據無效
dialog why can not show ?
message handle ,
Hierarchy Viewer
Adatpter view one click listener, api demo search ,has no extra config ,why
Editable etext = mEditText.getText();
Selection.setSelection(etext, etext.length());
editText.addTextChangedListener(new TextWatcher()
int cursor = blogEdit.getSelectionStart();
blogEdit.getText().insert(cursor,text);
重構時直接轉化爲field ,可以吧a_b 格式 轉化爲 aB
構造器 第一行,可以先用 get 方法,再設置爲field 。
如何 debug ,直接設debug
listContentView.new ClickListener() ,調用內部類
TextView ColorStateList
焦點一個 ,select 很多
ListView one click listener clickable
listView 回滾recycle 幾個View
android 多個style
http://stackoverflow.com/questions/2098558/listview-with-clickable-editable-widget/2098866#2098866
List View 顏色 , 背景框 ,圖片大小
ImageView 設置 ,有些選項要合作纔有效,但是 doc 上沒有談
cropToPadding
oldPwdEditText.setOnEditorActionListener(new OnEditorActionListener() {
oldPwdEditText.setError("請輸入舊密碼");
why get from xml can not get propery
需要 paser
XmlResourceParser parser = baseActivity.getResources().getLayout(R.layout.content_list);
AttributeSet attributeSet = null;
int state = 0;
do {
try {
state = parser.next();
} catch (Exception e1) {
e1.printStackTrace();
}
if (state == XmlPullParser.START_TAG) {
if (parser.getName().equals("ListView")) {
attributeSet = Xml.asAttributeSet(parser);
break;
}
}
} while(state != XmlPullParser.END_DOCUMENT);
拖拉的時候背景變黑
android:cacheColorHint
setAdapter 後 footview
why need add bottom view before set adapter
ListView 上不去
滾輪向上滾,相當於箭頭向下 ,和瀏覽器相反
mounted
/mnt/sdcard/LazyList
看不到路徑,但是可以用shell list
data/data/package/cache 路徑
rom
galley ,will show selection (default is first ) in the center .
we need setSelection to avoid left blank .
switch case lost break ,
why friend viw can not see ,
image name convertion ,
if not set compress area in 9 patch image ,it will inform error .
爲什麼有時候要加 notify
why define two handle ?
更改
data append
reply change .
short method ,only one function , need not optimize when only run one time .
ArrayList insert
why backgournd color
BitmapDecode
ImageGetter setbound
Using MultipartEntity in Android applications
http://blog.tacticalnuclearstrike.com/2010/01/using-multipartentity-in-android-applications/
需要額外增加一個包
The copy of HttpClient in Android does not actually match any of the released versions, as this mailing list trail shows. Google seem to have taken an arbitrary snapshot of the development code base and used that.
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/internal/http/multipart/MultipartEntity.java
internal code
use emulator in command
http://www.opcos.com/Google/Android/201011/5532719W0W.html
mksdcard 128M sdcard.img
emulator.exe -adv 2.2.854 -scale 0.75 -sdcard sdcard.img
adb push user.jpg /mnt/sdcard
adb push user.jpg /sdcard
最好的反編譯 apktool d weibo.apk weibo ,可以看所有resource 和 smali 還可以直接修改smali 來重新打包 也可以先用dex2jar ,然後再用 jshrink 來查看java code