?4? Android???? - PowerPoint PPT Presentation

1 / 62
About This Presentation
Title:

?4? Android????

Description:

4 Android 4.3 Activity ActivityLifeCycle / ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 63
Provided by: computer65
Category:
Tags: android

less

Transcript and Presenter's Notes

Title: ?4? Android????


1
?4? Android????
2
4.1 ??????
  • ???????
  • ?????????Android????????????????,???Android???????
    ????
  • ????????Android??????????

3
4.1 ??????
  • Android?????????????
  • ????
  • ????
  • ????
  • ????
  • ???

4
4.1 ??????
  • ????
  • ?????Android?????????,???????????,????????
  • ????Activity?????????
  • ?????Activity??,????Activity?????????
  • ??????????????????,?onCreate()?onStart()?onDestroy
    ()
  • ???BroadcastReceiver????onReceive()??
  • Android??????????????,????????????,???????????,???
    ????????????

5
4.1 ??????
  • ????
  • ??????????????????,??????????,??????????
  • ??????????,?????????????Activity??,????????????
  • Android?????????????,?????????,Android????????????
    ?????????

6
4.1 ??????
  • ????
  • ????????????????
  • ??????
  • ???????
  • Android???????????????????????,???????????

7
4.1 ??????
  • ????
  • ??????????????????,???????????Activity???
  • Android????????????????,????????,?????????????????
    ?????

8
4.1 ??????
  • ???
  • ????????????????
  • ?????????????????
  • ?????Android???????????,Android???????????????,???
    ????????,?????????
  • ?????????,??????????????
  • ???????????????????????
  • ??????????????????????

9
4.2 Android??
  • ??????????????,Android????????????
  • Android??????????,???Activity?Service?BroadcaseRec
    eiver?ContentProvider

10
4.2 Android??
  • Activity
  • Activity?Android??????,??????????,????????????????
  • Android?????????????Activity,?????????????Activity
    ,??????????????
  • ?????????????,???????,???
  • Service
  • Service????????,??????????????

11
4.2 Android??
  • BroadcaseReceiver
  • BroadcaseReceiver???????????????
  • ?????????
  • ??????Activity??Notification???????????
  • Notification????????????,?????????????????????????
    ???????

12
4.2 Android??
  • ContentProvider
  • ContentProvider?Android?????????????????,????????C
    ontentProvider?????????????
  • ??????????????????,????SQLite?????
  • Android????????????ContentProvider,???????????????
    ?

13
4.2 Android??
  • ??????
  • ??Android????????????,????????????????
  • ??????,?????????????????????????

14
4.3 Activity????
  • Activity????
  • Activity?????Activity?????????
  • Activity???????,???????????????????????
  • ????,Activity???????????,????????,?????????
  • ????,Activity?????????,?Activity????????????,?????
    ??????
  • ????,Activity?????????????,??????Activity???Activi
    ty????
  • ?????,??????????Activity????????

15
4.3 Activity????
  • Activity???????????

16
4.3 Activity????
  • Activity?
  • ?????????

17
4.3 Activity????
  • ???????

18
4.3 Activity????
  • Activity???????????

19
4.3 Activity????
  • Activity????/?????????

20
4.3 Activity????
  • Activity???????????
  • Activity??????
  • Activity???????????????????????????
  • ??????????????????

21
4.3 Activity????
  • ?????
  • ???????Activity??????????,??onCreate(),???onDestro
    y()
  • ??????onCreate()????Activity????????????,??onDestr
    oy()???????
  • ?????????,Android??????onDestroy()??,???????

22
4.3 Activity????
  • ??????
  • ???????Activity??????????????,???onStart(),???onSt
    op()

23
4.3 Activity????
  • ??????
  • onStart()????????????????????
  • onStop()??????????????????????????????
  • onRestart()???onSart()????,???Activity????????????
    ,???????????
  • onStart()?onStop()??????
  • onStart()?onStop()???????????BroadcastReceiver

24
4.3 Activity????
  • ??????
  • ???????Activity???????,???????????,???onResume(),?
    ??onPause()
  • ?Activity????????onResume()?onPause()?????,???????
    ??????????????

25
4.3 Activity????
  • ??????
  • onPause()??????????????
  • ?onPause()???,onStop()?onDestroy()????Android????
  • onPause()?????????,?????????????

26
4.3 Activity????
  • onPause()?onSaveInstanceState()???
  • ?????????????????????,???????
  • onPause()???????????,?????????????????????????
  • onSaveInstanceState()?????????????,???????Bundle?
  • Bundle??????????????
  • ?onSaveInstanceState()???Bundle????,?????onRestore
    InstanceState()?onCreate()?,?????Bundle????????

27
4.3 Activity????
  • ????????Android??
  • ????ActivityLifeCycle
  • ???edu.hrbeu.ActivityLifeCycle
  • Activity??ActivityLifeCycle

28
4.3 Activity????
  • ActivityLifeCycle.java?????

29
4.3 Activity????
  • ActivityLifeCycle.java?????

30
4.3 Activity????
  • ActivityLifeCycle.java?????

31
4.3 Activity????
  • ActivityLifeCycle.java?????
  • ?????????????????????????????,????????????LogCat
    ?
  • ?????????????,?LogCat?????LifeCycleFilter,??????by
    Log Tag,??????LIFTCYCLE

32
4.3 Activity????
  • ?????
  • ?????ActivityLifeCycle ?LogCat??
  • ??ActivityLifeCycle
  • ?????????
  • ??ActivityLifeCycle
  • LogCat????

33
4.3 Activity????
  • ?????
  • ???????onCreate() ? onStart()? onResume() ?
    onPause()? onStop()? onDestroy()
  • ??onCreate()??????
  • ??onStart()?Activity??????
  • ??onResume()??????
  • ??onPause()?onStop()?onDestroy(),?????????

34
4.3 Activity????
  • ??????
  • ????
  • ??ActivityLifeCycle
  • ???/????????????
  • ????????????
  • ActivityLifeCycle????????
  • ???????LogCat????

35
4.3 Activity????
  • ??????
  • ??????? onSaveInstanceState ()? onPause()?
    onStop() ? onRestart()? onStart()? onResume()
  • ??onSaveInstanceState()????Activity??
  • ??onPause()?onStop(),??????Activity???
  • ??onRestart()??????????????
  • ??onStart()?onResume()????Activity,???????

36
4.3 Activity????
  • ??????
  • ??IDA???????Dev Tools ? Development Settings ?
    Immediately destroy activities (IDA)???IDA

37
4.3 Activity????
  • ??????
  • ??IDA??????????????onSaveInstanceState()?
    onPause()? onStop()? onDestroy()? onCreate()?
    onStart()? onRestoreInstanceState()? onResume()
  • ??onRestoreInstanceState()??Activity??????
  • ???????????????????????

38
4.3 Activity????
  • ??????
  • ???????LogCat??
  • ??ActivityLifeCycle
  • ???????????????
  • ???????????
  • LogCat?????

39
4.3 Activity????
  • ??????
  • ????????onSaveInstanceState() ? onPause() ?
    onResume()
  • ??onSaveInstanceState ()??Activity???
  • ??onPause()???????
  • ??onResume()????????

40
4.4 ????
  • Android???????????LogCat?DevTools,??????
    ????????????
  • 4.4.1 LogCat
  • LogCat??????????????,??????Eclipse???????
  • ???????????Dalvik??????????????ActivityManager???
    PackagerManager???Homeloader ???WindowsManager???A
    ndroid?????????????

41
4.4 ????
  • 4.4.1 LogCat
  • ????Window ? Show View ? Other
  • ??Show View?????,???Andoird ? LogCat???LogCat

42
4.4 ????
  • 4.4.1 LogCat
  • LogCat???,????Eclipse?????

43
4.4 ????
  • 4.4.1 LogCat
  • LogCat?????????????????????? ,?????????
  • V??(Verbose)?? D??(Debug)??
  • I??(Info)?? W??(Warn)??
  • E ??(Error)??

44
4.4 ????
  • 4.4.1 LogCat
  • ?LogCat?,?????????????????????,??????????????LogCa
    t???,??????????????????

45
4.4 ????
  • 4.4.1 LogCat
  • LogCat???????,???????-?,???????????????????
    ??????(Tag)??????????(Pid)?????(Level),???????????
    ?

46
4.4 ????
  • 4.4.1 LogCat
  • ??????
  • ??android.util.Log?
  • ??Log.v()? Log.d()? Log.i() ?Log.w() ?
    Log.e()?????????????
  • ??????????,??????????????LogCat?
  • ?????????????????
  • ????????????
  • Log.v()????????,Log.d()????????,Log.i()????????,
    Log.w()????????,Log.e()?????????

47
4.4 ????
  • 4.4.1 LogCat
  • ???Log????????

48
4.4 ????
  • 4.4.1 LogCat
  • ???5???android.util.Log?
  • ?8?????????????LogCat??????????????,??????????????
    ??
  • ?14?????????,Log.v()??????????????,?????????????
  • ?15???18?????????????????????????

49
4.4 ????
  • 4.4.1 LogCat
  • LogCat???????
  • LogCat????????????????????

50
4.4 ????
  • 4.4.1 LogCat
  • ?????
  • ??
  • ????????LogcatFilter
  • ?????????LOGCAT

51
4.4 ????
  • 4.4.1 LogCat
  • LogCat????????
  • ???????????,???????,?????LOGCAT,?????LogcatFilter?
    ??

52
4.4 ????
  • 4.4.2 DevTools
  • DevTools???????????
  • ????????????????Development Settings?Exception
    Browser?Google Login Service?Instrumentation?Media
    Scanner?Package Browser?Pointer Location?Raw
    Image Viewer?Running processes?Terminal Emulator

53
4.4 ????
  • 4.4.2 DevTools
  • DevTools?????

54
4.4 ????
  • 4.4.2 DevTools
  • Development Settings
  • Development Settings?????????????
  • ?????????,?????????????
  • ??????????

55
4.4 ????
  • 4.4.2 DevTools
  • Development Settings??

56
4.4 ????
  • 4.4.2 DevTools

57
4.4 ????
  • 4.4.2 DevTools
  • Package Browser
  • Package Browser?Android???????????,???????????Andr
    oid????????,?????????????????????ID????apk????????
    ???????
  • ????????????Activity?Service?BroadcastReceiver?Pro
    vider?????

58
4.4 ????
  • 4.4.2 DevTools
  • Package Browser??ActivityLifeCycle???????

59
4.4 ????
  • 4.4.2 DevTools
  • Pointer Location
  • Pointer Location??????????,????????X????Y???
  • Pointer Location?????

60
4.4 ????
  • 4.4.2 DevTools
  • Running processes
  • Running processes?????Android??????????,??????????
    ?,????????????????
  • Andoird??????????????com.android.phone???????

61
4.4 ????
  • 4.4.2 DevTools
  • Andoird?????????????
  • com.android.phone???????

62
4.4 ????
  • 4.4.2 DevTools
  • Terminal Emulator
  • Terminal Emulator??????????Linux???????,????????,?
    ????????su??
  • ??????root?????,????ADB??
  • ???Terminal Emulator??????,??ls??,?????????????
Write a Comment
User Comments (0)
About PowerShow.com