查找一部手机的分辨率,cldc,midp,操作系统等开发需要了解的属性,很多商业手机网站都很少关注这些技术属性,因而我们有时找起来也麻烦,虽然有好多做这行的人都去整理了一些常用机器的表,但遇到一些公司没有的手机或者很偏门的机子时会很头疼,这个网站可以帮到你大忙:
http://www.jbenchmark.com/result.jsp
来自一家公司的收藏,这边贡献出来.
不清楚能否访问了,有网友有相关的资源,也可以评论分享一下,谢谢
//contacts
AccountSelectionUtil.java (packages\apps\contacts\src\com\android\contacts\util):
CallDetailActivity.java (packages\apps\contacts\src\com\android\contacts):
CallLog_DualCall.java (packages\apps\contacts\src\com\android\contacts):
ContactEditorView.java (packages\apps\contacts\src\com\android\contacts\ui\widget):
ContactPhotoLoader.java (packages\apps\contacts\src\com\android\contacts):
TwelveKeyDialer.java (packages\apps\contacts\src\com\android\contacts):
ViewContactActivity.java (packages\apps\contacts\src\com\android\contacts):
ContactsListActivity.java (packages\apps\contacts\src\com\android\contacts):
ContactsUtils.java (packages\apps\contacts\src\com\android\contacts):
EntityModifier.java (packages\apps\contacts\src\com\android\contacts\model):
FallbackSource.java (packages\apps\contacts\src\com\android\contacts\model):
GenericEditorView.java (packages\apps\contacts\src\com\android\contacts\ui\widget):
SpecialCharSequenceMgr.java (packages\apps\contacts\src\com\android\contacts):
QuickContactWindow.java (packages\apps\contacts\src\com\android\contacts\ui):
RecentCallsListActivity.java (packages\apps\contacts\src\com\android\contacts):
RelationCursorParcelable.java (packages\apps\contacts\src\com\android\contacts\util):
//phone
CallCard.java (packages\apps\phone\src\com\android\phone):
CallNotifier.java (packages\apps\phone\src\com\android\phone):
DTMFTwelveKeyDialer.java (packages\apps\phone\src\com\android\phone):
FakePhoneActivity.java (packages\apps\phone\src\com\android\phone):
FdnSetting.java (packages\apps\phone\src\com\android\phone):
NetworkSetting.java (packages\apps\phone\src\com\android\phone):
NotificationMgr.java (packages\apps\phone\src\com\android\phone):
OtaStartupReceiver.java (packages\apps\phone\src\com\android\phone):
OtaUtils.java (packages\apps\phone\src\com\android\phone):
OutgoingCallBroadcaster.java (packages\apps\phone\src\com\android\phone):
IccPinUnlockPanel.java (packages\apps\phone\src\com\android\phone):
InCallControlState.java (packages\apps\phone\src\com\android\phone):
InCallMenu.java (packages\apps\phone\src\com\android\phone):
InCallScreen.java (packages\apps\phone\src\com\android\phone):
InCallTouchUi.java (packages\apps\phone\src\com\android\phone):
PhoneApp.java (packages\apps\phone\src\com\android\phone):
PhoneInterfaceManager.java (packages\apps\phone\src\com\android\phone):
Ringer.java (packages\apps\phone\src\com\android\phone):
PhoneUtils.java (packages\apps\phone\src\com\android\phone):
//MMS
MessagingPreferenceActivity.java (packages\apps\mms\src\com\android\mms\ui):
//soundrecorder
SoundRecorder.java (packages\apps\soundrecorder\src\com\android\soundrecorder):
VUMeter.java (packages\apps\soundrecorder\src\com\android\soundrecorder):
Recorder.java (packages\apps\soundrecorder\src\com\android\soundrecorder):
//Launcher
Launcher.java (packages\apps\launcher2\src\com\android\launcher2):
//frameworks
AudioService.java (frameworks\base\media\java\android\media):
Ringtone.java (frameworks\base\media\java\android\media):
Settings.java (frameworks\base\core\java\android\provider):
Telephony.java (frameworks\base\core\java\android\provider):
ContactsContract.java (frameworks\base\core\java\android\provider):
ShutdownThread.java (frameworks\base\core\java\com\android\internal\app):
TelephonyManager.java (frameworks\base\telephony\java\android\telephony):
TelephonyRegistry.java (frameworks\base\services\java\com\android\server):
Intent.java (frameworks\base\core\java\android\content):
PLMN.java (frameworks\base\core\java\android\util):
ITelephonyRegistry.java (telephony\java\com\android\internal\telephony):
Call.java (frameworks\base\telephony\java\com\android\internal\telephony):
CallerInfo.java (frameworks\base\telephony\java\com\android\internal\telephony):
CallTracker.java (frameworks\base\telephony\java\com\android\internal\telephony):
CdmaCall.java (frameworks\base\telephony\java\com\android\internal\telephony\cdma):
CdmaCallTracker.java (frameworks\base\telephony\java\com\android\internal\telephony\cdma):
CdmaConnection.java (frameworks\base\telephony\java\com\android\internal\telephony\cdma):
CdmaServiceStateTracker.java (frameworks\base\telephony\java\com\android\internal\telephony\cdma):
DefaultPhoneNotifier.java (frameworks\base\telephony\java\com\android\internal\telephony):
GsmCall.java (frameworks\base\telephony\java\com\android\internal\telephony\gsm):
GsmCallTracker.java (frameworks\base\telephony\java\com\android\internal\telephony\gsm):
GsmServiceStateTracker.java (frameworks\base\telephony\java\com\android\internal\telephony\gsm):
IccCard.java (frameworks\base\telephony\java\com\android\internal\telephony):
KeyguardUpdateMonitor.java (frameworks\policies\base\phone\com\android\internal\policy\impl):
LockPatternKeyguardView.java (frameworks\policies\base\phone\com\android\internal\policy\impl):
LockScreen.java (frameworks\policies\base\phone\com\android\internal\policy\impl):
MidWindow.java (frameworks\policies\base\mid\com\android\internal\policy\impl):
PatternUnlockScreen.java (frameworks\policies\base\phone\com\android\internal\policy\impl):
PhoneFactory.java (frameworks\base\telephony\java\com\android\internal\telephony):
PhoneStateListener.java (frameworks\base\telephony\java\android\telephony):import com.android.internal.telephony.PhoneFactory;
PhoneWindow.java (frameworks\policies\base\phone\com\android\internal\policy\impl):
PhoneWindowManager.java (frameworks\policies\base\phone\com\android\internal\policy\impl):
StatusBarPolicy.java (frameworks\base\services\java\com\android\server\status):
StatusBarService.java (frameworks\base\services\java\com\android\server\status):
frameworks\base\core\res\res\layout\keyguard_screen_tab_unlock.xml
frameworks\base\core\res\res\values\array.xml
frameworks\base\core\res\res\values\config.xml
//SPN_STRINGS_UPDATED_ACTION "android.provider.Telephony.SPN_STRINGS_UPDATED";
1.viewroot.java中,应用程序主动调用invalidate或setEnable等调用间接调用invalidate,invalidate中会遍历view树,请求重绘需要绘制的区域
invalidate主要是确定需要重绘的区域,然后调用scheduleTraversals发起重绘请求,scheduleTraversals最终调用performTraversals遍历view tree进行重绘
2.measure:performTraversals首先会遍历调用view树中所有view的measure方法来测量出view的大小
从viewRoot的mView开始measure,这个mView是一个DecorView对象(继承自FrameLayout,属于ViewGroup),ViewGroup中没有覆写measure函数,事实上measure是一个final方法,无法覆写,所以所有view子类的measure都是调用view的measure
public final void measue(int widthMeasureSpec, int heightMeasureSpec);
viewRoot在measure中根据屏幕大小和DecorView的布局(FrameLayout)确定widthMeasureSpec和heightMeasureSpec来作为参数传入measue,measue里回调OnMeasure,view的OnMeasure对传入的参数通过一定的算法算出准确的长和宽,至此,DecView本身的大小就measure完了,而DecView中的子控件如何measure呢?
measure是final的,但是其回调的OnMeasure是virtual的,事实上,view和viewGroup的大小都是在OnMeasure中计算出来的,默认的OnMeasure只是计算出本view或viewGroup的大小,如果是自定viewgroup,我们可以重写onmeasure,把viewgroup的大小写死(这样布局xml里写的match_parent或者wrap_content就不起作用了),当然这样做是不建议的,通常viewGroup的子类都会重写Onmeasure,在里面除了调用view的onmeasure确定自己的大小外,也确定所有子view的大小(如果子view是viewgroup,再继续这个过程),那么怎么确定子view的大小呢,跟viewroot中确定decView类似,先根据父viewGroup的大小和布局确定传给子view的measure函数的参数widthMeasureSpec和heightMeasureSpec,子view调用measure函数计算出子view的最终大小(这个过程封装在viewgroup的MeasureChildren中了。
自定义viewGroup的子类时,一般要覆写OnMeasure方法,这这个Onmeasure方法里,可以调用ViewGroup的MeasureChildren,也可以自己直接调用所有子view的Measure(MeasureChildren不是自动调用的,只是提供给用户需要时手动调用的,很多android应用层的viewGroup子类都调用它来对子view做measure)
在没有measure之前,view是没有大小的,getMeasuredWidth、getMeasuredHeight()都是0,没有layout之前,getWidth和getHeight都是0,在layout中还可以重新确定控件大小,所以getwith和getHeight得到的值和getMeasuredWidth、getMeasuredHeight()得到的值不一定一样,前者是真实的绘制在屏幕上的大小,后者是measure执行完后的测量大小,当然,默认情况下,layout使用的是measure中测算的大小,除非覆写了OnLayout,在其中重定义了大小
所以多viewGroup子类而言,OnMeasure不是必须的,因为最终子view的大小和位置是layout决定的,onlayout才是必须的。
3. layout:measure完成后就会调用layout,同样是遍历view tree进行layout,layout方法也是final的:
public void layout(int left, int top, int right, int bottom)
自定义viewgroup放入布局xml中,父布局会调用其measure和layout,所以不用管,但是其子view都是靠自己measure和layout的,子view(非viewgroup)的Onmeasure和onlayout只是被父viewgroup调用默认的方法即可,无须重写,子viewgroup要重写Onmeasure和onlayout,为其下面的所有子view调用measure和layout(Onmeasure可选,onlayout必须)
viewroot根据前面的measure得到的MeasureWith和MeasureHeight调用DecorView的layout(0,0,MeasureWith,MeasureHeight),DecorView重写onlayout,在其中调用所有子view的layout,子view如果是viewgroup,则此子view再重写onlayout,以此类推。
layout中主要是确定其子view的位置和大小(大小可以用measure得到的大小,也可以自己再定义大小),以linearlayout为例,如果是垂直布局,则每layout一个子view,把下一个子view的top加上上一个view的高度,如果是自定义的viewgroup,则根据自己设计的布局需要来确定子view的layout位置,比如可以设计一个按长度适应屏幕自动换行的viewgroup
4.draw:同样是遍历view tree调用所有view的draw,draw的大小和位置已经由measure和layout确定好了
参考:
http://www.linuxidc.com/Linux/2012-01/51162p2.htm
http://www.2cto.com/kf/201207/139996.html