Android Framework Code Readingのしおり ver 1.3

Android Framework Code Readingのしおり ver 1.3

Android Framework Code Readingのしおり ver 1.3

まったりAndroid Framework Code Reading #5
https://mandroidfcr.connpass.com/event/53922/

E77b6a5f919f7366d94f21eee9a014f5?s=128

operandoOS

April 14, 2017
Tweet

Transcript

  1. Android Framework
 Code Readingͷ͓͠Γ ver 1.3

  2. ໨ඪ

  3. ໨ඪ • ಡΈ࢝ΊΔʹ͸Ͳ͔͜Β୳ͤ͹͍͍ͷ͔Θ͔Δ • Android Frameworkͷίʔυ͕ͳΜͱͳ͘
 ಡΊΔΑ͏ʹͳΔ • ΋͏Androidා͘ͳ͍ (ʆŋωŋ´)

  4. ༻ҙ͢Δ΋ͷ

  5. ༻ҙ͢Δ΋ͷ • ͓޷ΈͷEditor • OpenGrok • https://sites.google.com/site/devcollaboration/codesearch • ΫιίʔυಡΜͰ΋Ί͛ͳ͍ؾ࣋ͪ •

    جຊ͜Ε͚ͩ
  6. ಡΈ΍͍͢؀ڥΛ࡞Δ • FirefoxͷπϦʔܕλϒͱ͍͏֦ு͕Φεεϝ • https://addons.mozilla.org/ja/firefox/ addon/tree-style-tab/ • ಡΜͰ͍Δίʔυͷϝιουݺͼग़͠ͷ֊૚ ͱ͔؅ཧ͠΍͍͢

  7. ಡΈ΍͍͢؀ڥΛ࡞Δ ͜Μͳײ͡ʔ

  8. ಡΈ΍͍͢؀ڥΛ࡞Δ • Session Managerͱ͍͏֦ு΋Φεεϝ • https://addons.mozilla.org/ja/firefox/ addon/session-manager/ • ։͍ͯΔλϒͷঢ়ଶΛอଘͰ͖Δ

  9. ಡΈ΍͍͢؀ڥΛ࡞Δ ࠓ։͍ͯΔλϒͱ͔Λอଘ

  10. ಡΈ΍͍͢؀ڥΛ࡞Δ ͲΜͳίʔυಡΜͰΔͷ͔ͱ໊͔લʹ͓ͯ͘͠ͱ
 ಡΈฦ࣌͢ʹศར

  11. ಡΈ΍͍͢؀ڥΛ࡞Δ อଘͨ͠ͷ͸͜Μͳײ͡Ͱ෮ݩͰ͖Δʔ

  12. OpenGrok

  13. OpenGrok • ιʔείʔυΛϒϥ΢βͰӾཡͰ͖Δ΋ͷ • method΁ͷϦϯΫͱ͔షͬͯ͋ͬͯศརʂʂ • Androidͷιʔείʔυ΋OpenGrokԽͯ͋͠Γ·͢ • ιʔείʔυखݩʹͳͯ͘΋ಡΊͯศརʂʂ

  14. OpenGrokʹ׳ΕΔ

  15. OpenGrokʹ׳ΕΔ • Full SearchΛࢦఆ͢Δ • File PathΛࢦఆ͢Δ • جຊ্̎ͭͰ͍͍ͩͨOK •

    ࠔͬͨΒHelpΛݟͯ࢖͍ํΛϚελʔ͢Δ • http://tools.oesf.biz/android-6.0.0_r1.0/help.jsp
  16. खݩʹίʔυΛμ΢ϯϩʔυ͢Δ • શ෦ͷιʔείʔυΛμ΢ϯϩʔυ͢Δͷ͸େม • OpenGrok͔ΒFile୯ҐͰμ΢ϯϩʔυͰ͖Δ • Α͘ࢀর͢ΔϑΝΠϧ͸μ΢ϯϩʔυ͓ͯ͘͠ͱศར • URLͷxrefͱrawʹͯ͠ΞΫηε͢ΔͱBrowser
 ܦ༝Ͱμ΢ϯϩʔυͰ͖Δ͸ͣ

  17. खݩʹίʔυΛμ΢ϯϩʔυ͢Δ http://tools.oesf.biz/android-6.0.0_r1.0/xref/ frameworks/base/core/java/android/app/Activity.java http://tools.oesf.biz/android-6.0.0_r1.0/raw/ frameworks/base/core/java/android/app/Activity.java

  18. ҙ֎ͱखݩʹ͍࣋ͬͯΔιʔείʔυ • Android SDK Manager͔ΒऔಘͰ͖Δ΋ͷ • /Applications/Android Studio.app/sdk/sources • /Applications/Android

    Studio.app/sdk/extras/ android/support • /Applications/Android Studio.app/sdk/extras/ android/m2repository/com/android/support
  19. खܰʹಡΊͦ͏ͳͱ͜Ζ • frameworks/ • Android Frameworksશൠͷίʔυ • frameworks/base/core/java/ • Android

    SDKશൠͷίʔυ
  20. खܰʹಡΊͦ͏ͳͱ͜Ζ • packages/apps/ • γεςϜΞϓϦશൠͷίʔυ • http://tools.oesf.biz/android-6.0.0_r1.0/ xref/packages/apps/Settings/ • SettingsΞϓϦͷίʔυ(Φεεϝʂ)

  21. ໾ʹཱͪͦ͏ͳϦϯΫ·ͱΊͯ·͢ https://github.com/ AndroidFrameworkCodeReading/Android- Framework-Code-Reading

  22. GopenGrok https://github.com/operando/gopen-grok ίϚϯυϥΠϯ͔ΒOpenGrokͷ
 ݕࡧ͕Ͱ͖Δπʔϧ

  23. GopenGrok https://github.com/operando/gopen-grok $ gopen-grok -s Activity

  24. GopenGrok https://github.com/operando/gopen-grok

  25. GopenGrok Install https://github.com/operando/gopen-grok $ go get -d github.com/operando/gopen-grok $ go

    install github.com/operando/gopen-grok
  26. LogcatٯҾ͖

  27. LogcatٯҾ͖ • LogcatʹྲྀΕ͍ͯΔϩά͸ίʔυ্ʹ
 ॻ͍ͯ͋Δ͸ͣ(ಈతͳ΋ͷҎ֎ • ௐ΂͍ͨػೳͬΆ͍΋ͷ͕ྲྀͯ͠ΔLogcat͔Β ಛఆͷΩʔϫʔυͰݕࡧΛ͔͚Δ

  28. LogcatٯҾ͖ • ྫ͑͹ɺҎԼͷϩάͷgetDirectorySizeͬͯͲ ͏΍ͬͯௐ΂ͯΔ͔஌Γ͍ͨʂͱͯ͠…

  29. LogcatٯҾ͖ • ͡ΌͱΓ͋͑ͣʮgetDirectorySizeʯͬͯ
 ΩʔϫʔυͰOpenGrokݕࡧ͢Δ

  30. ʮgetDirectorySizeʯͷݕࡧ݁Ռ ݟࣄʹͦΕͬΆ΋ͷ
 Ҿ͔͔ͬͬͨ

  31. ίʔυΛݟΔͱ͜Μͳײ͡ • IMediaContaninerServiceͶʔ΁ʔ • LogcatʹྲྀΕͯͨͷ͸ 438ߦ໨ͷ΍ͭ

  32. LogcatٯҾ͖ • ͏·͘ώοτ͢Ε͹࠷ߴͷٕ • Ͳͷϩά͕ྑͦ͞͏͔ݟۃΊΔͷ͸৬ਓٕ • LogcatʹྲྀΕ͍ͯΔϝοηʔδ͕੩తͳ΋ͷ͔ ಈతͳ΋ͷ͔൑அ͢Δͷ͸৬ਓٕ

  33. ·ͱΊํ

  34. ͋ͱͰݟฦ͢Α͏ʹ͜͏ॻ͘ͱ͍͍͔΋ λΠτϧ
 ݟग़͠

  35. ͋ͱͰݟฦ͢Α͏ʹ͜͏ॻ͘ͱ͍͍͔΋ Θ͔ͬͨ͜ͱΛ
 Օ৚ॻ͖

  36. ͋ͱͰݟฦ͢Α͏ʹ͜͏ॻ͘ͱ͍͍͔΋ ॏཁͳͱ͜Ζ͸
 ίʔυͷURLͱ࣮ࡍͷίʔυΛ
 ίϐϖͯ͠ॻ͍͓ͯ͘

  37. ͋ͱͰݟฦ͢Α͏ʹ͜͏ॻ͘ͱ͍͍͔΋ • Markdownͱ͔Ͱద౰ʹॻ͘ • ίʔυͷURL͸ΊͬͪΌେࣄ • ॻ͍ͨΒGithub΍Gistʹஔ͍͓ͯ͘ͱ
 ݕࡧ΋Ͱָ͖ͯ

  38. JobScheduler-Code-Reading https://github.com/operando/JobScheduler-Code-Reading ·ͱΊํͷࢀߟʹͲ͏ͧʔ

  39. Thanks!!