Android Studioã«ã¯æ°çŸã®ãã©ã°ã€ã³ãããããã®æ°ã¯æ¥ã
å¢ããŠããŸãã ããã¯äž»ã«2ã€ã®çç±ã§èµ·ãããŸãã ãŸããAndroid Studioã¯Androidã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããããã®å
¬åŒã®çµ±åéçºç°å¢ã§ãã 次ã«ãAndroid Studioã®åºç€ãšãªããã©ãããã©ãŒã ã§ããIntellij IDEAã䜿çšãããšãäž¡æ¹ã®IDEãšäºææ§ã®ãã䟿å©ãªãã©ã°ã€ã³ãéçºããŠç°¡åã«ã€ã³ã¹ããŒã«ã§ããŸãã ã©ã®ãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ããŸããïŒ
ãã¡ãããåäžã®ãã©ã°ã€ã³ãè¿œå ããã®ã§ã¯ãªããå¿
èŠãªã©ã€ãã©ãªãã€ã³ã¹ããŒã«ããã ãã§ãã裞ã®ãAndroid Studioã§ããã°ã©ãã³ã°ã§ããŸãã ãããããªãã§ããïŒ Android Studioã®ãã©ã°ã€ã³ã¯ãäœæ¥ãããå¹ççã§æ¥œãããã®ã«ããŸãã 次ã«ãïŒå°ãªããšãïŒããã©ãŒãã³ã¹ã3åã«ã§ããAndroid Studioãã©ã°ã€ã³ã®ãããã«ã€ããŠèª¬æããŸãã
Android Studioã«æé©ãªãã©ã°ã€ã³ã®ãªã¹ãã«ã¯ãæéã§ãã¹ããããããã€ãã®åºæ¬çãªããŒã«ãšãAndroidã¢ããªã±ãŒã·ã§ã³ã®çµéšè±å¯ãªéçºè
ãæšå¥šããããã€ãã®ããŸãç¥ãããŠããªãå®ç³ãå«ãŸããŠããŸãã ã ãããããã«ç§ãã¡ã®ãæ°ã«å
¥ãã®Android Studioãã©ã°ã€ã³ããããŸãïŒ
ååã瀺ãããã«ããã®ãã©ã°ã€ã³ã¯æååã䜿çšããé¢åãªæäœæ¥ã®æéãç¯çŽããŸãã ããã¹ãã¹ã¿ã€ã« ïŒcamelCaseãkebab-lowercaseãKEBAB-UPPERCASEãsnake_caseãSCREAMING_SNAKE_CASEãdot.caseãlowercaseãCapital LettersãPascalCaseïŒã®å€æŽã ãšã³ã³ãŒã/ãã³ãŒããå¢å /æžå°ã䞊ã¹æ¿ãããã£ã«ã¿ãŒãæŽåãè¡ãããšãã§ããŸã ã
次ã®ãã©ã°ã€ã³ã§äœãã§ããããèŠãŠãã ããã Codotaãã©ã°ã€ã³ã¯ãæ©æ¢°åŠç¿ã䜿çšããŠã³ãŒããèªåè£å®ããŸã ã ãã©ã°ã€ã³ã¯ãç¬èªã®ã³ã³ããã¹ããšãšãã«ãæ°çŸäžã®Javaããã°ã©ã ã®ã³ãŒãäŸããåŠç¿ããŸãã åå¿è
ãšçµéšè±å¯ãªJavaéçºè
ã®äž¡æ¹ã䜿çšããCodotaã¯ãéçºãã¹ããŒãã¢ããããã³ãŒãã«çŸããåä»ãªãã°ãæé€ããã®ã«åœ¹ç«ã¡ãŸãã
ãã©ã°ã€ã³ã«å ããŠãCodotaã¯ãé©åãªå Žæã«ã³ããŒããŠè²Œãä»ããããã«ãäžè¬çã«äœ¿çšãããJavaã³ãŒãã®ã¹ããããã®åºç¯ãªã©ã€ãã©ãªãæäŸããŸãã
ãã®ã·ã³ãã«ãªãã©ã°ã€ã³ã¯ãäžèŠãããšæããããã¯ããã«äŸ¿å©ã§ãã ã³ãŒããšã¢ããªã±ãŒã·ã§ã³ã®ã³ã³ãã€ã«ãšå®è¡ãããè€éã«ãªããšãããã¯ããã»ããµã«åœ±é¿ããŸãã ããã»ããµäœ¿çšçã€ã³ãžã±ãŒã¿ã®æã䟿å©ãªæ©èœã®1ã€ã¯ã ã¹ã¬ãããã³ããçæããŠãããã¯ã°ã©ãŠã³ãã¹ã¬ããã§ããã»ããµãã©ã®ããã«è©°ãŸããããã瀺ãæ©èœã§ã ã
ãã©ã±ããã¯ãåžžã«ããã°ã©ãã«ãšã£ãŠé çã®çš®ã§ããã ãã®äžè¶³ããŠãããã©ã±ãããèŠã€ããã®ã«äœæéããããŸãããïŒ ãããŠïŒ
座ã£ãŠæ¢ã«éããŠãããã©ã±ãããšãŸã éããŠããªããã©ã±ãããææ¡ãã代ããã«ãRainbow Bracketsãã©ã°ã€ã³ã䜿çšããŠãã©ã±ãããè²ä»ãããŸã ã
JavaãScalaãClojureãKotlinãPythonãHaskellãAgdaãRustãJavaScriptãTypeScriptãErlangãGoãGroovyãRubyãElixirãObjectiveCãPHPãHTMLãXMLãSQLãApexãCïŒãDartãªã©ããµããŒãããŠããŸãèšèªã
Androidã¢ããªã±ãŒã·ã§ã³ã®è€éãªJavaã³ãŒãã«ã¯ãå€ãã®å®åã³ãŒãïŒã³ã³ã¹ãã©ã¯ã¿ãŒãã²ãã¿ãŒãã»ãã¿ãŒïŒãå«ãŸããããšããããããŸãã ããã¯ãèªã¿ããããšã³ãŒããµããŒãã®ç¹ã§é¢åã§å°é£ãªå ŽåããããŸãã Project Lombokã¯ãIDEã«æ¥ç¶ããŠãã®ãã³ãã¬ãŒãã³ãŒããçæããJavaã©ã€ãã©ãªã§ãããã³ãŒããç°¡æœã§èªã¿ããããã®ã«ããŸãã ååŸã®ã³ãŒãã®éãã¯éåžžã«é©ãã¹ããã®ã§ãã
ã³ã³ãã€ã«æã®ã©ã€ãã©ãªã§ããLombokã䜿çšããŠããã¢ããªã±ãŒã·ã§ã³ã®è² è·ã倧ãããªãããšã¯ãããŸããã ããã«ã ãµã€ãäžã®ãã©ã°ã€ã³éçºè
ã¯ããŠãŒã¶ãŒããã³ãã©ã°ã€ã³éçºè
ã«å€ãã®æçšãªãªãœãŒã¹ãæäŸããŸãã
Androidã¢ããªã±ãŒã·ã§ã³ã®éçºæã«drawableã䜿çšããå Žåãããã¯æ³šæãã¹ããã©ã°ã€ã³ã§ãã
Androidããã€ã¹ã®ãã¹ãŠã®ãµã€ãºãšç»é¢è§£å床ã«ãªãœãŒã¹ãé©åãããããã«ãåAndroidãããžã§ã¯ãã«ã¯æç»å¯èœãªãã©ã«ããŒããããŸãã ãã§ã«æ£ãããã©ã«ãã«æ£ããååã®ãªãœãŒã¹ãæäŸããŠããParadiseã®ãã¶ã€ããŒã«æµãŸããŠãããªããå¿ããããããŸããã ããããã»ãšãã©ã®å Žåãããªãã¯ããã»ã©å¹žéã§ããå¯èœæ§ã¯äœããèªåã§PNGãã¡ã€ã«ã®ååãå€æŽããç®çã®ãã©ã«ããŒã«ç§»åããŸãã
Android Drawable Importerã¯ãèšå€§ãªæéãç¯çŽãããã©ã°ã€ã³ã§ãã ããã«ãããå¿
èŠãªãµã€ãºãšæš©éãžã®èŠå¶ã®ããã«åå¥ã®ãªãœãŒã¹ãã€ã³ããŒãããå¿
èŠãªãã©ã«ããŒã«èªåé
眮ããããã®zipãã¡ã€ã«å
šäœãã€ã³ããŒãã§ããŸã ã
ãã¯ã¿ãŒXMLãã¡ã€ã«ããã¬ãã¥ãŒããã«ã¯ãã¢ããªã±ãŒã·ã§ã³ãå®è¡ããå¿
èŠããããŸãã Vector Drawable Thumbnailsã¯ããããåãé€ããã¯ã³ã¯ãªãã¯ã§ãã¯ã¿ãŒå³é¢ã衚瀺ããã®ã«åœ¹ç«ã¡ãŸãã
ãããžã§ã¯ãã«æç»å¯èœãªã³ã³ããŒãã³ããå€æ°ããå Žåãããããããã²ãŒãããã®ã¯éåžžã«å°é£ã§ãã IDEã«ç°¡åãªç»åãã¬ãã¥ãŒãããã°ããã§ããã Android Drawable Preview Pluginã䜿çšãããšããããå¯èœã«ãªããŸãã
ãã®Android Studioçšãã©ã°ã€ã³ã¯ããããžã§ã¯ããã¡ã€ã«ããªãŒã®ããã©ã«ãã¢ã€ã³ã³ãèŠçŽ ãã¬ãã¥ãŒã«çœ®ãæããŸã ã ããããdrawableã«é©åãªååã䜿çšããããšãå¿ããªãã§ãã ãããããã¯ãŸã éèŠã§ãã
ç¥è©±ãæã¡ç Žãããšããå§ããŸãããã ãã¹ãŠã®å¥³æ§ãã¿ãŒã³ã€ãºãšã¢ã¯ã¢ããªã³ããŸãã¯ãã¹ãšãã©ã ãåºå¥ã§ããããã§ã¯ãããŸããã ãã®ãããè²èŠç°åžžã§ããå¿
èŠã¯ãããŸããã
ãã®ãã©ã°ã€ã³ã®ååšãšäººæ°ã¯ãã»ãšãã©ã®éçºè
ã«ããã®éæ³ã®è²èªèã¹ãã«ããªãããšã瀺åããŠããŸãã
Name That Colorãã©ã°ã€ã³ã¯ãAndroid Studioã®ãªãœãŒã¹ãã¡ã€ã«ã§çŽæ¥ã¯ãªããããŒãã«ããè²ã«ååãä»ããæãè¿ãäžèŽããè²ã®ååãä»ããŸãã xmlãã¡ã€ã«ã®lighter_light_pinkæ代ã¯çµããã«è¿ã¥ããŠããŸãã
bundletoolã¯ãGradleãAndroid Studioãããã³Google PlayãAndroidã¢ããªãã³ãã«ãäœæããããã¢ããªãã³ãã«ãããã€ã¹ã«ãããã€ãããããŸããŸãªAPKã«å€æãããããããã«äœ¿çšããåºæ¬ããŒã«ã§ã ã Googleã®ãã®ããŒã«ã¯ãAPKããã±ãŒãžãããå¹æçã«äœ¿çšããããã«å¿
èŠã§ãã
Android ButterKnifeã¯ã äŸåæ§æ³šå
¥ã©ã€ãã©ãªã§ãã ååãšããŠãããã«ããã³ãŒãã®å¯èªæ§ãåäžããViewã³ã³ããŒãã³ããæ€çŽ¢ããããªã¹ããŒãè¿œå ãããããããã«ããŒãã«ã³ãŒããæ··åšãããã®ã§ã¯ãªããããžãã¯ã«éäžã§ããããã«ãªããŸãã
Android ButterKnife Zeleznyã¯ãã¢ã¯ãã£ããã£ãã¹ããããããŸãã¯ã¢ããã¿ãŒã§éžæããXMLã¬ã€ã¢ãŠãããButterKnifeã€ã³ãžã§ã¯ã·ã§ã³ãäœæããããã®Android Studioãã©ã°ã€ã³ã§ãã ã»ãšãã©ã®ButterKnifeããã¥ã¢ã«ã§ã¯ãZeleznyã®ã€ã³ã¹ããŒã«ãæšå¥šããŠããŸãã
Android Inputã¯ã Androidããã€ã¹ããšãã¥ã¬ãŒã¿ãŒã«çŽæ¥ããã¹ããç°¡åã«å
¥åã§ããAndroid Studioçšã®éåžžã«ã·ã³ãã«ã§ãã䟿å©ãªãã©ã°ã€ã³ã§ãã æåŸã«äœ¿çšããããã€ã¹ãšæåŸã«å
¥åããããã¹ããèšæ¶ããŸãã
Intellij IDEAãšAndroid Studioã®äž¡æ¹ã®ãã®ãã©ã°ã€ã³ã¯ãIDE ã§ããŸããŸãªADBããŒã«ã³ãã³ãã®äŸ¿å©ãªããŒããŒãã·ã§ãŒãã«ãããè¿œå ããŸãã ããã¯ããéãã®ããã«æããŸãããéçºè
ã¯ãADB IdeaãAndroidã¢ããªã®éçºãšãããã°ãæ¬åœã«ã¹ããŒãã¢ããã§ãããšèšããŸãã
ãAndroidã®ãã¹ããšéçºçšã®ã¹ã€ã¹ãã€ãããšåŒã°ããadb-extendedã¯ãããŸããŸãªã¹ã¯ãªãããå®è¡ããããã®ã³ãã³ãã©ã€ã³ã€ã³ã¿ãŒãã§ã€ã¹ã§ãã ããã«ãããç»é¢ã®å転ãããããªãŒã»ãŒããŒã¢ãŒããããŒã¿ã»ãŒãã¢ãŒããã¹ã¿ã³ãã€ã¢ãŒããèš±å¯ã®ä»äžãŸãã¯åãæ¶ããªã©ã å€ãã®æœåšçã«ãšã©ãŒã®ããã¢ããªã±ãŒã·ã§ã³ã®åäœããã¹ãã§ããŸãã
ãã®ãã©ã°ã€ã³ã«ããããããã°ã®ããã«WiFiçµç±ã§ããã€ã¹ãADBã«ç°¡åã«æ¥ç¶ã§ããŸã ã ä»ã®å€ãã®å°ãããŠã䟿å©ãªãã©ã°ã€ã³ãšåæ§ã«ãããã¯ã³ãã³ãã©ã€ã³ã§å®è¡ã§ããäžé£ã®ã³ãã³ãã®åãªãã©ãããŒã§ãã ãããããã®ããã»ã¹ãããå¿«é©ã«ããŠã¿ãŸãããïŒ
ãã©ãŽã³ãºã«ã¯ãIntellijãšAndroid Studioãã©ã°ã€ã³ããããŸããããã«ããããæ±ãããJavaã¡ãœããã«@SideEffectã¢ãããŒã·ã§ã³ãä»ããããšãã§ããŸã ã ãã®ã¡ãœãããåŒã³åºããšããã©ã°ã€ã³ã¯å°ããªãã©ãŽã³ã¢ã€ã³ã³ã衚瀺ããŸãã
ããã«ããã®ãã©ã°ã€ã³ã¯å¯æãããŠãªã¹ãã«å«ããããŸããã ãããã¯ãã©ãŽã³ã§ãïŒ
ãåç¥ã®ããã«ãã³ãŒãã¯å£®å€§ã§ãã äžæ©äžã¿ã©ãããè¡ã«ã«ãã§ã€ã³ãå€ãå«ãŸããŠãããšãæãç«ãåŽããäžçãæºãã¶ãã®ãæããããšãã§ããŸãã ããªãã¯ç¥ã§ãã ãããŠãããªãã¯ç¥ã®ããã«ããã°ã©ã ããã«å€ããã
ãããŠæåŸã«
ãªã¹ããããã¹ãŠã®ãã©ã°ã€ã³ã®ã€ã³ã¹ããŒã«ãéå§ããåã«ãå€ãã®ãã©ã°ã€ã³ãéåžžIDEã®é床ãäœäžãããããšã«æ³šæããŠãã ããã ã³ãŒããæžããŠããéãããªãã®ç¿æ
£ãèããAndroid Studioã«äœåãªééãè¿œå ããããšãªãæéãç¯çŽãããã©ã°ã€ã³ã確èªããŠãã ããã