杂项4

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值