Android入门培训(测试实习生)

前一段时间给公司的测试实习生做了Android入门的培训。要讲的明白,确实需要查阅的东西比较多,现在将ppt分享出来。


Topics

1, Android verision ,developer history and version distribution

2, Basic concept (Activity, Service, Broadcast receiver, ContentProvider-Database)

3, Screen classification

4, Adb command

5, Log analysis

6, Signature


Android

1,mobile phone os (ios,wp,blackberry)

2,open source

3,2008年9月 android 1.0

4,75% (2012 Q3)


1-1 Android version

image


1-2 Developer history

image


1-3 Version distribution

image


1-4 What’s next

Android 5.0 (Key Lime Pie )

June 15, 2013~June 17, 2013

image





1-5 Reference

http://developer.android.com/about/dashboards/index.html


http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels



2-1 Activity

image



2-2 service

(1) time consuming (download)

(2) stay in background (mp3)


2-3 Broadcast receiver

Global


(1) network connect state

(2) power boot


2-4 database

Add

Delete

Update

Select


2-5 Other proper

Sdk(Software Development Kit)

Demo


3-1 classification

(1) size

(2) density

image


3-2 Proper noun

(1) Screen size : diagonal length, inch

(2) Screen density: pots/inches

(3) Rosolution: width* height pots

(4) Density-independent pixel :dip

mdpi: 160dpi 1dip-1px


3-3 Size & density

image


xlarge screens are at least 960dp x 720dp

large screens are at least 640dp x 480dp

normal screens are at least 470dp x 320dp

small screens are at least 426dp x 320dp


3-4 Reference

http://developer.android.com/guide/practices/screens_support.html


4-1 adb

1,stands for android debug bridge


2, It is a client-server program

(1) client

(2) server

(3) daemon


4-2 adb category

image



4-3 adb command

4-3-1 check the connect state

adb devices

Q: can not connect

A: delete the Wandoujia process


adb kill-server


4-3-2 select device/emulator

adb �Cd

adb �Ce

adb �Cs <serialNumber>


4-3-3 install/uninstall

adb �Cs <serialNumber> <path_to_apk>

adb �Cd install <path_to_apk>

adb �Ce install <path_to_apk>


adb uninstall <package>


4-3-4 pull/push

adb pull <remote> <local>

adb push <local> <remote>


4-3-5 data


cd


cat sharedpreference


sqlite3 webview.db

.head on

select * from cookies;


4-3-6 process/memory usage

adb shell ps

image


user: root/system/media/ 进程拥有者的登录名

pid: process identity 进程id

name: path/package name


adb shell top

image

User    用户进程

System  系统进程


CPU使用情况(指一个最小时间片内所占时间,单位jiffies。或者指所占进程数):

User    处于用户态的运行时间,不包含优先值为负进程

Nice    优先值为负的进程所占用的CPU时间

Sys 处于核心态的运行时间

Idle    除IO等待时间以外的其它等待时间

IOW IO等待时间

IRQ 硬中断时间

SIRQ    软中断时间


进程属性:

PID 进程在系统中的ID

CPU%    当前瞬时所以使用CPU占用率

S   进程的状态,其中S表示休眠,R表示正在运行,Z表示僵死状态,N表示该进程优先值是负数。

#THR    程序当前所用的线程数

VSS Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)

RSS Resident Set Size 实际使用物理内存(包含共享库占用的内存)

PCY OOXX,不知道什么东东

UID 运行当前进程的用户id


adb shell


input text ‘the_input_content’


4-3-7 logcat


adb logcat

adb logcat �Cs <tag>

adb logcat �Cc

adb logcat > log_file.txt

adb logcat �Cv

cls


4-4 Reference

http://developer.android.com/tools/help/adb.html




5-1 Error type

Type:


(1)Force close

(2) Crash

(3)ANR(application not response)


5-2 FC

Caused by:

(1) Null pointer

(2) Missing resource

(3) Api

….

Location:

(1) AndroidRuntime

(2) has died


5-3 Crash

Direct close


Location:

log


Eg,/system/lib/libhwui.so


5-4 ANR

Conditions:


(1)No response to an input event (such as key press or screen touch events) within 5 seconds.


(2)A BroadcastReceiver hasn't finished executing within 10 seconds.


Location:

(1) log file

1-1 CPUusagefrom 3697ms to 4223ms later

1-2 100%TOTAL:4.8% user + 7.6% kernel + 87% iowait

cpu high: device is busy

cpu low: the main thread is blocked

iowait high: the main thread ‘s block may from io operation


(2) trace file (data/anr/trace)

stack



6-1 Signature


(1) identity

(2) apk upgrade (conflick )

(3) app module (theme, addon)

(4) Unique (apk changes, the signature invalid)

你可能感兴趣的:(test,adb,developer,Training)