Upgrade to Pro — share decks privately, control downloads, hide ads and more …

1ヶ月でAndroidカメラアプリ開発(1/4)

sakebook
April 04, 2016

 1ヶ月でAndroidカメラアプリ開発(1/4)

Adobe Creative SDKを使った写真加工アプリの開発のスライドです。全4回。

sakebook

April 04, 2016
Tweet

More Decks by sakebook

Other Decks in Programming

Transcript

  1. ̍ϲ݄Ͱ ANDROIDΧϝϥΞϓϦ։ൃ @Trunk ञຊ৳໵ 2016/3/13

  2. ͸͡Ίʹ

  3. ࣗݾ঺հ ञຊ৳໵ ੴ઒ݝ @sakebook Android 3೥͘Β͍ iOS ൒೥ͪΐͬͱ ϥΠϑϩά޷͖

  4. ຊ೔ͷྲྀΕ • ࡞ΔΞϓϦͷσϞ • Androidʹ͍ͭͯ • ։ൃ؀ڥઃఆ • ։ൃ؀ڥղઆ •

    ΞϓϦͷσόοά • ιʔείʔυ؅ཧ • Adobe SDKಋೖ
  5. ࡞ΔΞϓϦͷσϞ

  6. ANDROID

  7. ANDROIDͱ͸ • Google͕։ൃ͢ΔΦʔϓϯιʔεͳ
 ϞόΠϧ޲͚ϓϥοτϑΥʔϜ

  8. ΞʔΩςΫνϟ https://ja.wikipedia.org/wiki/Android

  9. όʔδϣϯ • ࡉ͔͍΋ͷΛؚΊΔͱ
 20Ҏ্΋ͷछྨ
 (API LEVEL) • 4.1Ҏ͕߱90%ऑΛ઎ΊΔ
 (2015/6/1)

  10. APK • ΞϓϦͷ֦ுࢠ • Application PaKage
 ͔Β͖͍ͯΔ • ։ൃͨ͠ΞϓϦ͸̋̋.apk
 ͱ͍͏ܗʹͳΔ

  11. ։ൃ؀ڥ

  12. ANDROID STUDIO • Intellij IDEAΛϕʔεʹͨ͠౷߹։ൃ؀ڥ(IDE) • Google͕։ൃ • Androidͷ։ൃʹಛԽ •

    Eclipse͸ଔۀ͍ͯͩ͘͠͞(ADT͕։ൃऴྃ)
  13. ͊͞͸͡ΊΑ͏

  14. NEW PROJECT • Application name • ΞϓϦͷ໊લ • Company Domain

    • ࣗ෼ΛϢχʔΫʹ
 ͢ΔυϝΠϯ
  15. NEW PROJECT • Package name • ΞϓϦΛϢχʔΫʹ
 ͢Δจࣈྻ • ଞͷΞϓϦͱॏෳېࢭ

    • Project location • PC಺ͷϓϩδΣΫτύε
  16. NEW PROJECT • Phone and Tablet • API 16(4.1) •

    Empty Activity • Activity ≒ ը໘ • ͦͷ··(ޙ͔ΒมߋՄೳ)
  17. ϓϩδΣΫτߏ੒

  18. • ϓϧμ΢ϯΛ
 Android -> Project
 ʹมߋ

  19. • MyApplication(Root) • ϓϩδΣΫτϧʔτ • .gradle/ • ϩʔΧϧϦϙδτϦ • .idea/

    • IDEͷઃఆঢ়گ
  20. • build/ • Ϗϧυ࣌ͷ
 ϑΝΠϧஔ͖৔ • gradle/ • Ϗϧυʹඞཁͳ
 Gradleஔ͖৔

    • .gitignore • gitͰ؅ཧ͠ͳ͍΋ͷΛ
 ࢦఆ • build.gradle • ϓϩδΣΫτͷ
 ґଘؔ܎Λهड़
  21. • gradle.properties • Gradle͕
 ࢀর͢ΔϓϩύςΟ • gradlew • Linuxͷ
 Gradle࣮ߦϑΝΠϧ

    • gradlew.bat • Windowsͷ
 Gradle࣮ߦϑΝΠϧ
  22. • local.properties • ݸਓͷ؀ڥͷSDKͷ
 ύεͷઃఆ • MyApplication.iml • IntellijͷϑΝΠϧ •

    setting.gradle • GradleͷϏϧυϞδϡʔϧΛهड़ • External Libraries • ϓϩδΣΫτͷ
 ֎͔Βࢀর͍ͯ͠Δ
 ϥΠϒϥϦ
  23. • app/ • Ϟδϡʔϧ • app/libs • ϩʔΧϧϥΠϒϥϦ
 ஔ͖৔ •

    app/build.gradle • ϞδϡʔϧͷϏϧυͷઃఆ΍
 ґଘؔ܎Λهड़ • app/proguard-rules.pro • ೉ಡԽʹ༻͍Δ
  24. • src • ίϯύΠϧର৅ͷ
 ϑΝΠϧஔ͖৔ • src/androidTest • ςετϑΝΠϧஔ͖৔ •

    src/main/java • ιʔεϑΝΠϧஔ͖৔ • src/main/res • ϦιʔεϑΝΠϧஔ͖৔
  25. • drawable • ը૾΍xmlΛஔ͘৔ॴ • layout • ϨΠΞ΢τͷxmlΛ
 ஔ͘৔ॴ •

    menu • ϝχϡʔͷxmlΛஔ͘৔ॴ • mipmap • ΞΠίϯը૾Λஔ͘৔ॴ
  26. • dpi
 (Dot Per Inch: ը໘ີ౓) • mdpi(48x48) • hdpi(72x72)

    • xhdpi(96x96) • xxhdpi(144x144)
  27. • dimens.xml • จࣈͷαΠζ΍
 ༨നͷ஋ͳͲΛ
 ఆٛͰ͖Δ • strings.xml • ςΩετΛఆٛͰ͖Δ

    • styles.xml • ΞϓϦͷςʔϚΛ
 هड़Ͱ͖Δ
  28. • AndroidManifest.xml • ΞϓϦͱ୺຤ؒͷ
 Permission΍
 ActivityͳͲͷ
 ৼΔ෣͍ɺ
 Package nameͳͲ
 ༷ʑͳ͜ͱΛ


    ઃఆͰ͖Δ
  29. ANDROID STUDIO SETTING

  30. ίʔυิ׬ • ్த·Ͱೖྗ͢Δͱ༧ଌͰ
 ݱࡏར༻ՄೳͳީิΛදࣔͯ͘͠ΕΔ • Android Studio -> Preference ->

    
 Keymap ->ʮCompletionʯ
 (޷͖ͳίϚϯυΛׂΓ౰ͯΔ)
  31. ߦ਺දࣔ • ϑΝΠϧͷࠨଆʹݱࡏͷߦ਺Λ
 දࣔͯ͘͠ΕΔ • Android Studio -> Preference ->

    
 Editor -> General -> Appearance ->
 ʮShow line numbersʯ
 (νΣοΫΛೖΕΔ)
  32. GENERATE • ࣗಈੜ੒Ͱ͖Δ΋ͷ΁ͷγϣʔτΧοτ
 (⌘+n)

  33. ࠔͬͨ࣌ • (Alt + Enter)Ͱͦͷ৔ͰͰ͖Δ͜ͱΛ
 αδΣετͯ͘͠ΕΔ

  34. ଞʹ΋ͨ͘͞Μ • http://qiita.com/sugoi_wada/items/ db449d5cbb5c83cb586c • http://qiita.com/takke/items/ 5cbc629f7f65d6a49906

  35. Ϗϧυ

  36. ϏϧυγεςϜ • Gradle • GroovyͰهड़Ͱ͖Δ • setting.gradleͰର৅ͱͳΔϞδϡʔϧΛࢦఆ • app/build.gradleʹϏϧυ࣌ͷλεΫΛهड़ •

    ίϚϯυϥΠϯ or ASͷػೳͰϏϧυ࣮ߦ
  37. None
  38. ίϚϯυϥΠϯ • $./gradlew assembleDebug • BuildType͕DebugͰϏϧυ͞ΕͨapkΛ
 app/build/outputs/apk ʹ࡞੒ • $./gradlew

    installDebug • ର৅ͷσόΠεʹapkΛΠϯετʔϧ
  39. ࣮ػ OR ΤϛϡϨʔλ

  40. ࣮ػ͕ͳ͚Ε͹ΤϛϡϨʔλ • ७ਖ਼ͷ΋ͷ͸͋͘ͼ͕ग़Δ΄Ͳ஗͍ • 2.x͔Βૣ͘ͳΔΒ͍͠ɻ • GenymotionΛ࢖͏

  41. GENYMOTION • ര଎ͷΤϛϡϨʔλ • ແྉ൛ͩͱ੍ݶ͕͋Δ͕ɺ
 ௨ৗར༻ͳΒे෼ • https://www.genymotion.com/

  42. LOGCAT

  43. LOGCAT • ઀ଓ͞Ε͍ͯΔσόΠε͕ྲྀ͍ͯ͠ΔϩάΛ ऩूɾදࣔ͢Δػೳ

  44. දࣔͤ͞Δ • ΍ͬͱίʔυʹ৮Δʂʁ • 14ߦ໨ʹ
 Log.d(“Trunk”, “onCreate”);

  45. ͜͏͍͏ͱ͖͕ • Alt + Enterͷग़൪ʂ

  46. දࣔ͞Εͨ • ݟ෼͚͕
 ͭ͘Α͏ʹ
 ͳͬͨ

  47. अຐͳ΋ͷΛഉআ͍ͨ͠ • FilterΛ࡞੒͢Δ

  48. ݟ΍͘͢ͳͬͨʂ

  49. ࢖͍෼͚ • Log.v(String tag, String msg) ʮ৑௕ʯ • Log.d(String tag,

    String msg) ʮσόοάʯ • Log.i(String tag, String msg) ʮ৘ใʯ • Log.w(String tag, String msg) ʮܯࠂʯ • Log.e(String tag, String msg) ʮΤϥʔʯ
  50. BREAKPOINT

  51. BREAK POINT • LogcatͩͱΫϥογϡͨ͠৔ॴͰɺଞͷ஋͕ Ͳ͏ͳ͍ͬͯΔ͔ͳͲ͕Θ͔Βͳ͍ • Ϋϥογϡ͢Δ෇͔ۙΒಈ͖Λ
 ͭͿ͞ʹ௥͍͍ͨʂ

  52. DEBUG • ϓϩάϥϜΛ
 ࢭΊ͍ͨ৔ॴʹ
 ੺ؙΛઃஔ • ʮhogeʯͷ
 ஋ΛݟͯΈΔ

  53. ͓࢖͍ͷσόΠε͸ਖ਼ৗͰ͢ • σόΠεଆʹද͕ࣔ
 ͰΔ͕଴ͭ

  54. εςοϓΦʔόʔ • 15ߦ໨ͰBreak • ࢭ·ͬͨߦ͸
 ͦͷ࣌఺Ͱ͸
 ධՁ͞Εͳ͍

  55. • ʮhogeʯ͕ఆٛ
 ͞Ε͍ͯΔ

  56. • ʮhogeʯͷ
 த਎͕”huga”ʹ
 ͳ͍ͬͯΔ

  57. ෳ਺ઃஔͨ࣌͠ • ݱࡏͷ
 Breakpoint͔Β
 ൈ͚ͨΓ઀ଓΛ
 ੾Δ͜ͱ΋
 Ͱ͖Δ

  58. ιʔείʔυ؅ཧ

  59. GIT • ෼ࢄܕόʔδϣϯ؅ཧγεςϜ • GitHub • GitΛ༻͍ͨWebαʔϏε

  60. Α͘࢖͏ίϚϯυ • git status • git diff ϑΝΠϧ • git

    checkout ϑΝΠϧ • git add ϑΝΠϧ • git commit -m “ϝοηʔδ” • git pull “ϦϞʔτϦϙδτϦͷURL” “ϩʔΧϧͷϒϥϯν໊” • git push “ϦϞʔτϦϙδτϦͷURL” “ϩʔΧϧͷϒϥϯν໊”
  61. • git status • ݱࡏͷϒϥϯνͰ
 มߋ͕͋Δ͔Ͳ͏͔Λ֬ೝ • git diff ϑΝΠϧ

    • ର৅ͷϑΝΠϧͷ
 Ͳ͜ʹมߋ͕͋Δͷ͔Λ֬ೝ
  62. • git checkout ϑΝΠϧ • ର৅ͷϑΝΠϧͷ
 ϩʔΧϧϦϙδτϦͰͷมߋΛ໭͢ • git add

    ϑΝΠϧ • ର৅ͷϑΝΠϧΛcommitର৅ʹ͢Δ
  63. • git commit -m “ϝοηʔδ” • commitର৅ʹͨ͠ϑΝΠϧͨͪΛ
 pushର৅ʹ͢Δ • git

    pull “ϦϞʔτϦϙδτϦͷURL” “ϩʔΧϧͷ ϒϥϯν໊” • ϦϞʔτϦϙδτϦͷมߋΛϩʔΧϧʹ൓ өͤ͞Δ
  64. • git push “ϦϞʔτϦϙδτϦͷURL” “ϩʔΧ ϧͷϒϥϯν໊” • pushର৅ʹͨ͠ϑΝΠϧͨͪΛϦϞʔτ ϦϙδτϦ΁push͢Δ

  65. ~/.GITCONFIG [user] name = Shinya Sakemoto email = sakebook@gmail.com [color]

    ui = auto [alias] st = status br = branch -a ch = checkout cm = commit stt = status -uno difff = diff --word-diff • Α͘࢖͏΋ͷ͸
 ొ࿥͓ͯ͘͠ͱศར
  66. ৄ͘͠͸ • http://blog.nanapi.co.jp/tech/2014/04/23/git-love/

  67. GITHUBʹొ࿥͠Α͏ • ઌ΄Ͳ࡞੒ͨ͠ϓϩδΣΫτΛొ࿥ • GitHubͰద౰ͳϦϙδτϦ࡞੒ • $git remote add origin

    ϦϙδτϦ
  68. ADOBE CREATIVE CLOUD

  69. SDK • Software Development Kit • ࠓճͩͱAdobe͕ఏڙ͍ͯ͠ΔػೳΛɺΞϓϦ಺ ʹ૊ΈࠐΉ͜ͱ͕Ͱ͖Δɻ • https://creativesdk.adobe.com/docs/android/#/articles/

    gettingstarted/index.html • Ұॹʹઃఆ͠·͠ΐ͏