ããŒã«ãç¥ã
Android Studio
ã·ã§ãŒãã«ããã䜿çšããããšãå¿ããªãã§ãã ãã
説æ | Mac | Linux /åå© |
IDEã®èšå®ãã¢ã¯ã·ã§ã³ã®ã¯ã€ãã¯æ€çŽ¢ | Cmd + Shift + A | Ctrl + Shift + A |
芪ã¯ã©ã¹ã¡ãœããããªãŒããŒã©ã€ããã | Cmd + o | Ctrl + O |
ååã§ãã¡ã€ã«ãæ€çŽ¢ãã | Cmd + Shift + O | Ctrl + Shift + N |
æè¿ç·šéããããã¡ã€ã«ã®ãªã¹ã | Cmd + Shift + E | Ctrl + Shift + E |
æè¿éãããã¡ã€ã«ã®ãªã¹ã | Cmd + e | Ctrl + E |
æåŸã«ç·šéãããã¡ã€ã« | Cmd + Shift + Backspace | Ctrl + Shift + Backspace |
ã¡ãœãã/å€æ°ã䜿çšãããŠãããã¹ãŠã®å ŽæãèŠã€ãã | Opt + F7 | Alt + F7 |
åã®ã¢ã€ãã ãšåæ§ã«ããããã¢ããã®ã¿ | Cmd + Opt + F7 | Ctrl + Alt + F7 |
ã³ãŒããã³ãŒãã¹ã¿ã€ã«ã«ãã | Cmd + Opt + L | Ctrl + Alt + L |
ã³ãŒããããã¯ãã³ã³ã¹ãã©ã¯ãã§å²ã¿ãŸãïŒããã§ãªãå Žåã¯è©ŠããŠãã ããïŒ | Opt + Cmd + T | Alt + Ctrl + T |
ãªãŒãã³ã¿ãŒããã« | Opt + F12 | Alt + F12 |
ã»ãã¿ãŒã®çæ/ã²ãã¿ãŒ/ | Cmd + n | Alt + Ins |
ååã§ã¯ã©ã¹ãæ€çŽ¢ãã | CMD + O | Ctrl + N |
ååãªãã¡ã¯ã¿ãªã³ã° | Shift + F6 | Shift + F6 |
ã¯ã€ãã¯ãã£ãã¯ã¹ | Opt + Enter | Alt + Enter |
å€æ°ãã¯ã©ã¹ãã¡ãœããã®å®£èšã«ç§»å | Cmd + b | Ctrl + B |
ã¡ãœããã®ãã©ã¡ãŒã¿ãŒã®ãªã¹ãã衚瀺ãã | Cmd + p | Ctrl + P |
ãªãã¡ã¯ã¿ãªã³ã°ã¡ãã¥ãŒ | Ctrl + T | Ctrl + Alt + Shift + T |
ããã»ã¹ã匷å¶çµäºãã | Cmd + f2 | Ctrl + F2 |
ãããžã§ã¯ãå šäœãæ€çŽ¢ãã | Shift + Shift | Shift + Shift |
è¡ãåé€ | Cmd +ããã¯ã¹ããŒã¹ | Ctrl + Y |
è¡ãè€è£œ | Cmd + d | Ctrl + D |
éžæç¯å²ã®æ¡å€§/çž®å° | Opt +äž/äžç¢å°ã㌠| Shift + Ctrl + W |
è€æ°è¡éžæ | Ctrl + G | Alt + J |
ã·ã§ãŒãã«ããã®å šãªã¹ã | Macosx | Linux /åå© |
ãã©ã°ã€ã³ã䜿çšããŠå¹çãé«ãã
- ããŒããã¢ãŒã¿ãŒ
ãã®ãã©ã°ã€ã³ã¯ãIDEã®ãã¿ã³ãã¯ãªãã¯ãã代ããã«äœ¿çšããå¿ èŠãããããŒããŒãã·ã§ãŒãã«ãããåãã倧ããªããããã¢ããã衚瀺ããããšã§èŠãã¿ãŸãã ãã°ãããããšããã®ã²ã©ããããã¢ããã衚瀺ãããªãããã«ããããã«ããã·ã³ã§æ¢ã«ã·ã§ãŒãã«ããã䜿çšããŸãã
- æååæäœ
æååã®æäœãç°¡çŽ åãããœãŒããä»ã®ãšã³ã³ãŒãã£ã³ã°ãžã®å€æãéè€ã®åé€ãããã¹ãã®ããªãã³ã°ãªã©ãå¯èœã«ããŸãã
- è¡ãœãŒã¿ãŒ
ã¡ãã¥ãŒã«ã¢ã€ã³ã³ãè¿œå ããŠãéžæãããŠããè¡ãŸãã¯äœãéžæãããŠããªãå Žåã¯ãã¡ã€ã«å šäœããœãŒãããŸãã
- Findbugs
Android Studioã䜿çšããŠJavaã³ãŒãã®ãã°ãæ€çŽ¢ããããã®éçãã€ãã³ãŒãã¢ãã©ã€ã¶ãŒã
- ãœããŒãªã³ã
ãã©ã°ã€ã³ãå®è¡æã«ãJavaãJavaScriptãããã³PHPã®æ°ãããã°ãšã³ãŒãå質ã®éåã«é¢ããæ å ±ã衚瀺ããŸãã
- ãã§ãã¯ã¹ã¿ã€ã«
Android Studioã䜿çšããŠJavaãã¡ã€ã«ãã¹ãã£ã³ããèšå®ã®ã³ã³ãã©ã€ã¢ã³ã¹ããã§ãã¯ãããã©ã°ã€ã³ã ãã«ãã·ã¹ãã ã«çµ±åããŠãéåã®ãããã«ããé²ãããšãã§ããŸãã
- ADBã®ã¢ã€ãã¢
Android StudioãšIntellijã«ADBã³ãã³ãïŒã¢ããªã±ãŒã·ã§ã³ã®ã€ã³ã¹ããŒã«ãšã¢ã³ã€ã³ã¹ããŒã«ãã¢ããªã±ãŒã·ã§ã³ã®åèµ·åãªã©ïŒãè¿œå ãããã©ã°ã€ã³ã
Android Studioã§ã®éçºæã«ã©ã€ããã³ãã¬ãŒãã䜿çšãã
ãã³ãã¬ãŒã | 説æ |
newInstance
| ãã©ã°ã¡ã³ãå ã§éç㪠`newInstance`ã¡ãœãããçæããŸã |
Toast
| Toast.makeTextïŒcontextã ""ãToast.LENGTH_SHORTïŒ.showïŒïŒ;ãçæããŸã |
fbc
| ç®çã®ãã¥ãŒã¿ã€ãã«åãããfindViewById |
const
| intå®æ°ãå®çŸ©ããŸã |
logd
| Log.dïŒTAGã ""ïŒãçæããŸãã |
logm
| ã¡ãœããã®çŸåšã®ååãšåŒæ°ãèšé²ããŸãã |
logr
| çŸåšã®ã¡ãœããã®çµæãèšé²ãã |
logt
| çŸåšã®ã¯ã©ã¹åãæã€ãã°ã®éçã¿ã°æåå |
psf
| ãããªãã¯ã¹ã¿ãã£ãã¯ãã¡ã€ãã« |
sout
| System.outã«æååãåºåããŸã |
soutm
| System.outã®ã¯ã©ã¹åãšã¡ãœããåãåºåããŸã |
soutp
| System.outã§ã¡ãœããã®åŒæ°ãšå€ãåºåããŸã |
visible
| ãã¥ãŒã®å¯èŠæ§ãå¯èŠã«èšå®ããŸã |
gone
| ãã¥ãŒGONEã®å¯èŠæ§ãèšå®ãã |
noInstance
| ãšã³ãã£ãã£ã®äœæãçŠæ¢ããåŒæ°ã®ãªããã©ã€ããŒãã³ã³ã¹ãã©ã¯ã¿ãŒ |
â Android Studioã®ã©ã€ããã³ãã¬ãŒãã®å šãªã¹ã
Android Studioã§ã®Postfixã³ãŒãè£å®
Android Studio / IntelliJã«ã¯ãç¹å®ã®å€æ°ã«æ§é ãé©çšã§ããã³ãŒããè¿œå ããããã®ç¹å¥ãªã¡ã«ããºã ããããŸãã
ãã³ãã¬ãŒã | 説æ |
| |
| |
|
|
|
|
| |
| |
| |
å©çšå¯èœãªåŸçœ®ã³ãŒãã®è¿œå ã®å®å šãªãªã¹ãã¯ãèšå®âãšãã£ã¿ãŒâåŸçœ®ãã³ãã¬ãŒãã«ãããŸãã
Android Studioã§DarculaããŒãã䜿çšãã
ã¯ããããã¯ãã£ãšå¥œã¿ã®åé¡ã ãšæããŸãã ãã ããæãããŒãã䜿çšãããšãç®ã®è² æ ã軜æžããããšä¿¡ããŠãã ããã
äžäŸ¿ãª/å°ããªæŽ»åã䜿çšããªãã§ãã ãã
å¯èœã§ããã°ãèªã¿ããããç®ã«äžå¿«æãäžããªããã©ã³ãã䜿çšããŠãã ããã Menloãã©ã³ãã䜿çšããŠããŸãã
ã³ãŒãã¹ã¿ã€ã«ã䜿çšãã
æšæºã®ã³ãŒãã¹ã¿ã€ã«ã䜿çšããå¿ èŠããããŸãã äŸãšããŠã AOSP CodestyleãŸãã¯Square IntelliJ Codestyleãã芧ãã ãã
Android Studioã§åã蟌ã¿ç«¯æ«ã䜿çšãã
Android Studioã®ã¡ã¢ãª/ãããã¯ãŒã¯/ CPUç£èŠã䜿çšããŠãã¢ããªã±ãŒã·ã§ã³ã®ãããã¡ã€ã«ãäœæããŸã
ãšãã¥ã¬ãŒã¿ãŒ
å®éã®ããã€ã¹ã䜿çšããããšã«å ããŠãæ§æãšäœ¿çšãç°¡åã§ããããããšãã¥ã¬ãŒã¿ã䜿çšããå¿ èŠããããŸãã APIã®ãã¹ãçšã«ãAPIã®è§£å床ãšããŒãžã§ã³ãç°¡åã«æ§æããããšãã§ããŸãã Genymotion ã SDKã«ä»å±ã®Intelãšãã¥ã¬ãŒã¿ãŒ
ãã€ã¶ãŒ
ããã¯ç¹çã«å€ããéåžžã«äŸ¿å©ãªããŒã«ã§ãã å®éãAndroidããã€ã¹ã®ã³ã³ãã³ããããŒãããœã³ã³ã®ç»é¢ã«ã¹ããªãŒãã³ã°ã§ããŸãã ãã¬ãŒã³ããŒã·ã§ã³ã§ã¢ããªã±ãŒã·ã§ã³ã®ãã¢ããã¢ããå¿ èŠãããå Žåã«éåžžã«äŸ¿å©ã§ãã å®éã®ããã€ã¹ãšå¯Ÿè©±ããããšãã§ããããããã¹ãŠãã©ãããããç»é¢ã«è¡šç€ºãããŸãã ç¡æçãšææçããããææçã¯è³Œå ¥ãã䟡å€ããããŸãã
ãã¹ã¯ããã¯
ïŒããŒããŒããšããŠã¹ã䜿çšããŠïŒç©ççãªAndroidããã€ã¹ãæäœããå¿ èŠãããå Žåããã®ã¢ããªã±ãŒã·ã§ã³ã¯ãããããŸãåŠçããŸãã Androidããã€ã¹ãã³ã³ãã¥ãŒã¿ãŒã®ãã¹ã¯ãããã®äžéšã§ãããã®ããã«å¶åŸ¡ã§ããŸãã ç¡æçã§ã¯ããŠã¹ã䜿çšã§ãã ææçã§ã¯ããŒããŒãããã®ä»ã®æ©èœã䜿çšã§ããŸãã ãã®ã¢ããªã±ãŒã·ã§ã³ã䜿çšãããšãããŒãããœã³ã³ã®ããŒããŒãããæãé¢ããã«ã¢ããªã±ãŒã·ã§ã³ããã¹ãã§ããŸãã
ã³ãŒããæžããšãã«æé©ãªããŒã«ãéžæããŠãã ãã
- HttpUrlConnectã®ä»£ããã«OkHttpã䜿çšããŸãã
HttpUrlConnectã«ã¯ã äžå®æ°ã®ãã°ãå«ãŸããŠããŸãã Okhttpã¯ããªãããŸã決å®ããŸããã Okhttpã®çºè¡š ã
- 次ã®ããã«ããŒã«ã«ã® `aar`ãã¡ã€ã«ã«ãªã³ã¯ããŸã ã
dependencies { compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar') } repositories { flatDir { dirs 'libs' } }
- Pidcatã䜿çšããŠãã°ããã䟿å©ã«åŠçãã
- ããŒãžã§ã³ç®¡çã·ã¹ãã ïŒVCSïŒãã§ããã°gitã䜿çšãã
- ClassySharkã䜿çšãã
.apkã.jarã.classã.dexã.aarã.soãªã©ã®ãã¡ã€ã«ãåæã§ããAndroidéçºè åãã®ç¹å¥ãªããã°ã©ã ã ã¯ã©ã¹ã®ãã£ãŒã«ããšã¡ãœãããäŸåé¢ä¿.apkãã¢ããªã±ãŒã·ã§ã³ã§äœ¿çšãããã¡ãœããã®æ°ãªã©ã«é¢ããæ å ±ã衚瀺ã§ããŸãã
- ã¹ããã䜿çšãã
Chrome Dev Toolsã䜿çšããŠã¢ããªã±ãŒã·ã§ã³ããããã°ã§ããŸãã ãããã¯ãŒã¯ã¢ãã¿ãŒïŒãããã¯ãŒã¯ã¢ãã¿ãŒïŒãå ±æèšå®ã®è¡šç€ºãå«ãŸããŸãã
- Battery Historianã䜿çšãã
ããããªãŒæ¶è²»ãåæããããã®ããã°ã©ã
- äŸåé¢ä¿ã䜿çšããå Žåã¯ãåžžã«å®æ°ã䜿çšããŠãã ããã ããšãã°ãã24.2.0ã
䜿çšããã©ã€ãã©ãªã®ããŒãžã§ã³ã瀺ãããã«ã+ãã䜿çšããªãã§ãã ããã
ããã«ãããæ°ããããŒãžã§ã³ã§APIãå€æŽãããå Žåã«ãäºæããªããã°ããã«ãã®åé¡ãåé¿ã§ããŸãã ãŸããã¢ã»ã³ããªäžã«ãäŸåã©ã€ãã©ãªã®ææ°ããŒãžã§ã³ã確èªããããã«æ¯åã€ã³ã¿ãŒãããæ¥ç¶ãéãå¿ èŠã¯ãããŸããã
- TimerTaskã®ä»£ããã«ãã³ãã©ãŒã䜿çšãã
- å人ã®å人çšã¡ãŒã«ã䜿çšããŠã¢ããªã±ãŒã·ã§ã³ãå
¬éããªãã§ãã ããã
- PNGã®ä»£ããã«ãã¯ãã«ã䜿çšãã
ãŸã pngãããå Žåã¯ãããããçµããŸãã ããã«ã€ããŠã¯ã[TinyPNG]ïŒhttps://tinypng.comïŒãã芧ãã ããã
- ããã¬ãŒãã䜿çšãã
android { ... buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }
- shrinkResourcesã䜿çšãã
android { ... buildTypes { release { shrinkResources true minifyEnabled true ... } } }
- ããã¯ã°ã©ãŠã³ãã§ã¢ããªã±ãŒã·ã§ã³ã®ã·ã¹ãã ã®åŒ·å¶çµäºãã·ãã¥ã¬ãŒãããã«ã¯ãã¿ãŒããã«ã§å®è¡ããŸã
adb shell am kill
- gradleãã«ããé«éåããããã®èšå®ã調ã¹ã
Gradle memory >= Dex memory + 1Gb
- ãã€ãã£ãã³ãŒãã䜿çšããå Žåã¯ã.apkãgradleã§åºåããŸãã ããªããèŠãã¿ããœãŒã¹ãç解ããã®ã§ããã¹ãŠãäžç·ã«æ··ããªãã§ãã ããã
defaultConfig { ... ndk { abiFilters "armeabi", "armeabi-v7a", "mips", "x86" } } //Split into platform dependent APK splits { abi { enable true reset() include 'armeabi', 'armeabi-v7a', 'mips', 'x86' //select ABIs to build APKs for universalApk false //generate an additional APK that contains all the ABIs } } // map for the version code project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'mips': 5, 'x86': 8] // Rename with proper versioning android.applicationVariants.all { variant -> // assign different version code for each output variant.outputs.each { output -> output.versionCodeOverride = project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1000000 + android.defaultConfig.versionCode } }
- MVPãClean Architectureãªã©ã®ã¢ããªã±ãŒã·ã§ã³ã¢ãŒããã¯ãã£ãæ§ç¯ããæ¹æ³ãåŠã¶
- TDDã®ååïŒãã¹ãé§åéçºïŒãç解ããŠäœ¿çšãã
- ãã£ãã·ã¥ãããäŸåé¢ä¿ãgradleã«åèªã¿èŸŒã¿ããã
./gradlew --refresh-dependencies
- ã¢ã»ã³ããªäžã«gradleã¿ã¹ã¯ãé€å€ããŸãã ã¿ã¹ã¯ãjavaDocããé€å€ãããšããŸãããã®å Žåãã-xããªãã·ã§ã³ãšã¿ã¹ã¯ã®ååã䜿çšããŸãããã®äŸã§ã¯ãjavaDocã
./gradlew clean build -x javaDoc
- ããŸããŸãªgradleããªãã¯
- DRYïŒèªåãç¹°ãè¿ããªãã§ãã ããïŒã®ååã«åŸã£ãŠãã ãã
- ã¬ã€ã€ãŒã§ã¯ãªãæ©èœããšã«ããã±ãŒãžãåé¢ãã
- äŸåé¢ä¿ã®ç«¶åã解決ããæ¹æ³ãåŠã¶
Androidã©ã€ãã©ãªãšãã®æŽæ°ã®éçºé床ãèãããšãããæç¹ã§ãã¢ããªã±ãŒã·ã§ã³ã§äŸåé¢ä¿ã®ç«¶åãçºçããŸãã Gradleã§ã¯ããããã®åé¡ãå ¬åŒããã¥ã¡ã³ãã§è§£æ±ºã§ããŸã
- å¥ã®ããã±ãŒãžåã䜿çšããŠã¢ã»ã³ããªããããã°ãã
android { buildTypes { debug { applicationIdSuffix '.debug' versionNameSuffix '-DEBUG' } release { // ... } } }
- Androidã¢ããªã±ãŒã·ã§ã³ã§ã®ã¡ã¢ãªãªãŒã¯ã®ç¢ºèªãšä¿®æ£
- ãªãœãŒã¹ã®ããã©ã«ãåã䜿çšããŸãã
- èªåã§gradleã¿ã¹ã¯ãæžãå§ããŸã
Androidã¯Gradleãã¢ã»ã³ããªã·ã¹ãã ãšããŠäœ¿çšããŸããããã«ãããå€ãã®äœæ¥ãç°¡çŽ åããèªååã®ããã®ç¬èªã®ã¿ã¹ã¯ãäœæã§ããŸãã å€ãã®äŸ¿å©ãªgradleã¹ã¯ãªãããå«ãredditã®æçš¿ ã
- ãã®ãããªAndroidãããžã§ã¯ãã§é©åãª.gitignoreã䜿çšããŸã
- LeakCanaryã䜿çšããŠãã¢ããªã±ãŒã·ã§ã³ã®ã¡ã¢ãªãªãŒã¯ãæ€åºããŸãã
- Android Studio 2.2以éã§ã®gradleãã«ãã®é«éå
-gradleããŒãžã§ã³3.1ã«ã¢ããã°ã¬ãŒãããŸãã
ãããžã§ã¯ããã£ã¬ã¯ããªã§æ¬¡ã®ã³ãã³ããå®è¡ããŠãgradleã©ãããŒãæŽæ°ããŸãã
./gradlew wrapper --gradle-version 3.1
-`gradle.properties`ãã¡ã€ã«ã§ãã«ããªãã·ã§ã³ãã°ããŒãã«ã«èšå®ãã
android.enableBuildCache=true
- gradleã§ãã«ãããã»ã¹ãåæ¢ãã
./gradlew -stop
- æ¬ èœããŠããAndroid SDKã³ã³ããŒãã³ããèªåçã«ããŠã³ããŒãããããã«gradleãæ§æããŸãã
ã°ããŒãã«gradle.propertiesãã¡ã€ã«ã§æ¬¡ã®ãªãã·ã§ã³ãèšå®ããŸãã
android.builder.sdkDownload=true
ããã¯å®éšçãªãªãã·ã§ã³ã§ããããã«ãããŒã«ãšãã©ãããã©ãŒã ã®ã¿ãããŠã³ããŒãããŸããã GoogleãŸãã¯ãµããŒããªããžããªã¯æŽæ°ããŸããã
- build.gradleãã¡ã€ã«ã«jcenterïŒïŒãšmavenCentralïŒïŒãåæã«å«ããªãã§ãã ããã
JCenterã«ã¯MavenCentralãå«ãŸããŠããŸã ã
- Android SDKã§æäŸãããŠãããµããŒãã©ã€ãã©ãªãšGoogle PlayãµãŒãã¹ã©ã€ãã©ãªã«äºææ§ããªããšæãããå Žåã¯ãgradleãã£ãã·ã¥ãæ¶å»ããŠãã ããã
ã/ .gradle / caches /ãã£ã¬ã¯ããªã«ç§»åãããã£ãã·ã¥ãã©ã«ããŒå ã®ãã¹ãŠã®ã³ã³ãã³ããåé€ããŸãã
SDKãããŒãžã£ãŒãéãããã¹ãŠã®ãµããŒãã©ã€ãã©ãªãšGoogle PlayãµãŒãã¹ãååæããŸãã
次ã«ããããžã§ã¯ãã®gradleäŸåé¢ä¿ãæŽæ°ããŸãã
ããã§ãã¹ãŠãè¯å¥œãªç¶æ ã«ãªããæ£ããåäœããã¯ãã§ãã
- 端æ«ã«äŸ¿å©ãªãadbããšã€ãªã¢ã¹ãèšå®ããŸãã
ã/ .bashrcãŸãã¯ã/ .zshrcãã¡ã€ã«ã«æ¬¡ã®ã³ãã³ããè¿œå ããä¿åããŠã¿ãŒããã«ãåèµ·åããŸãã ãã®åŸã 䜿çšæ³ã®åã«ç€ºãããã«äœ¿çšã§ããŸãã
ãšã€ãªã¢ã¹ 䜿çšãã alias screenshot="adb exec-out screencap -p > screen-$(date -j "+%s").png"
screenshot
alias startintent="adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb -s X shell am start $1"
startintent https://twitter.com/nisrulz
alias apkinstall="adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb -s X install -r $1"
apkinstall ~/Desktop/DemoApp.apk
alias rmapp="adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb -s X uninstall $1"
rmapp com.example.demoapp
alias clearapp="adb devices | tail -n +2 | cut -sf 1 | xargs -IX adb -s X shell pm clear $1"
clearapp com.example.demoapp
- ã³ãŒãã«// STOPSHIPãå«ãŸããå Žåããã«ãæã«ã¯ã©ãã·ã¥ããããã«Android Studioãèšå®ããŸãã
//STOPSHIP
ãªã³ããã§ãã¯ãæå¹ã«ããã«ã¯ã `build.gradle`ã«è¿œå ããŸã
android { ... lintOptions { abortOnError true fatal 'StopShip' } }
ã³ãŒãã«//STOPSHIP
ã³ã¡ã³ããããå ŽåããªãªãŒã¹ãã«ãã¯ãã«ããããŸããã ããã«ãAndroid Studioã§ãã®ãããªã³ã¡ã³ãã®åŒ·èª¿è¡šç€ºãæå¹ã«ããããšãã§ããŸãïŒããã©ã«ãã§ã¯ãªãïŒãPreferences â Editor â Code Style â Inspections
ã ã¹ãããã·ãããæ€çŽ¢ãããã§ãã¯ããã¯ã¹ããªã³ã«ããŠåŒ·èª¿è¡šç€ºããŸãã
- ãããã§ã¹ãã«ãªã¹ããããŠãããã¹ãŠã®æš©éãä»äžããã«ã¯ããadb install -gãã䜿çšããŸãã
- Alfiã䜿çšããŠãååã§ã©ã€ãã©ãªãæ€çŽ¢ããŸãã gradleã¢ããªã±ãŒã·ã§ã³ã®ãã«ãã¹ã¯ãªããã«å«ããæååãããã«è¡šç€ºãããŸãã ããã¯åºæ¬çã«ãWebã¢ããªã±ãŒã·ã§ã³ã§ããGradleã®ã³ã³ãœãŒã«ããŒãžã§ã³ã§ãã
alfi $name_of_library$
ç®çã®ã©ã€ãã©ãªãã³ããŒããŸãã build.gradleã«è²Œãä»ããŸãã
- Dryrunã䜿çšããŠãã©ã€ãã©ãªãŸãã¯ãµã³ãã«ã¢ããªã±ãŒã·ã§ã³ãè¿
éãã€äŸ¿å©ã«ãã¹ãããŸãã
dryrun $REMOTE_GIT_URL$
- åäœãã¹ãã®çµæãã³ã³ãœãŒã«ã«çŽæ¥è¡šç€ºããŸãã
android { ... testOptions.unitTests.all { testLogging { events 'passed', 'skipped', 'failed', 'standardOut', 'standardError' outputs.upToDateWhen { false } showStandardStreams = true } } }
- ãªãã©ã€ã³ã¢ãŒãã䜿çšããŠããéããã«ãããŸã ã
--offline
ãã©ã°ã¯ããã«ãæã«ãã£ãã·ã¥ã®äŸåé¢ä¿ã䜿çšããããã«--offline
æ瀺ããŸãã ãã®ãã©ã°ã䜿çšããŠã¢ã»ã³ããªãå®è¡ãããšãgradleã¯ãããã¯ãŒã¯çµç±ã§äŸåé¢ä¿ãããŠã³ããŒãããããšããŸããã å¿ èŠãªã¢ãžã¥ãŒã«ããã£ãã·ã¥ã«ãªãå Žåãã¢ããªã±ãŒã·ã§ã³ã¯ãã«ããããŸãã
- ãããã°ãã«ããã§ããã ãéããã«ãããŸãã
./gradlew assembleDevelopDebug --offline
- ã§ããã ãæ©ãåäœãã¹ããå®è¡ããŸãã
./gradlew test --offline
- ãã¬ãŒãå¥ã®ã¯ã©ã¹ã«ã«ãã»ã«åãã
- ã©ã€ãã©ãªãèªåçã«åæåããå Žåã¯ãã³ã³ãã³ããããã€ããŒã䜿çšããŸãã Firebaseã®ä»çµã¿ãã芧ãã ããã
䟿å©ãªUI / UXã®ãã³ã
ã ãŒãã¡ã³ã
ææèšèšã§ã¯ãçŸå®äžçã®ç©çåŠãåºç€ãšããŠäœ¿çšããŸãã çŸå®ã®äžçã®ãªããžã§ã¯ãã¯çŽç·çã«ç§»åããã®ã§ã¯ãªãã湟æ²ããçµè·¯ã«æ²¿ã£ãŠç§»åããç¶æ³ã«å¿ããŠå éãšæžéãè¡ããŸãã
ãããã£ãŠãèªç¶ã«èŠããããã«ããããã£ãæäœãããªããžã§ã¯ããã¢ãã¡ãŒã·ã§ã³åããå¿ èŠããããŸãã ããšãã°ãç»é¢ãé¢ããŠé転ããŠããè»ã¯ãã£ãããšåãå§ããç»é¢ã®ç«¯ã«åãã£ãŠåŸã ã«å éããŸãã åæ§ã«ãUIèŠçŽ ã¯AccelerateInterpolatorãFastOutSlowInInterpolatorãªã©ã®ã¯ã©ã¹ã䜿çšããŠç§»åããå¿ èŠããããŸã ã
ãã©ã³ããã€ã³ãã³ã
ååãšããŠãéæšæºãã©ã³ãã¯ãã©ã³ãåã®äžéšãšããŠäœ¿çšã§ããŸãããå¯èœã§ããã°ãç¹ã«èªèãšé »ç¹ãªäœ¿çšã®ããã«ã¡ã€ã³ããã¹ãã«ã€ããŠã¯ãæšæºã®RobotoãšNotoã䜿çšããããšããå§ãããŸãã
Robotoã¯ã©ãã³æåãã®ãªã·ã£æåãããªã«æåãã«ããŒããNotoã¯ä»ã®èšèªãã«ããŒããŸã ã
ãã©ã³ãã®æããã®ãã©ã³ã¹ã¯ãçŸä»£ã®ã¹ã¿ã€ãªã³ã°ã®æãéèŠãªãã©ã¡ãŒã¿ãŒã®1ã€ã§ãã åºæ¬çãªèãæ¹ã¯ããã©ã³ããå°ãããã°å°ããã»ã©æãããªãããšã§ãããéããŸãåæ§ã§ãã
ããã¹ãèªäœã¯ã4dpã»ã«ã§ã°ãªããã«æããå¿ èŠããããŸãã
1è¡ããã40ã60æåã®å€§ããªãããã¯ã®çæ³çãªããã¹ãé·ã
ã¢ã€ã³ã³
ã¢ã€ã³ã³ã®ãµã€ãºã¯48dpã§ããšããžã¯1dpã§ããå¿ èŠããããŸãã
48px x 48px - mdpi
72px x 72px - hdpi
96px x 96px - xhdpi
144px x 144px - xxhdpi
192px x 192px - xxxhdpi
Google Playã«ã¯ããµã€ãºã512px x 512pxã®è¿œå ã®ã¢ã€ã³ã³ãæäŸããå¿ èŠããããŸãã
ã¢ããªã±ãŒã·ã§ã³ã®ããŒãžã®ããããŒã«è¡šç€ºããã1024px x 500pxã®ãµã€ãºã®ã¢ã€ã³ã³ã«ãåãããšãåœãŠã¯ãŸããŸãã
ãªããã«
ãªããã«å¹æãå®è£ ãããšãã¯ã
?android:attr
ã moreã®ä»£ããã«
?android:attr
?attr/selectableItemBackground
䜿çšã
?attr/selectableItemBackground
ã Button useã®ãããªèŠçŽ ã«ãªããã«å¹æãå®è£ ããå Žå ïŒ
android:background="?attr/selectableItemBackground"
ImageViewãªã©ããã¥ãŒã®ç«¯ãè¶ ããŠåºãããªããã«ãå®è£ ããå Žåã¯ã次ã䜿çšããŸã ã
?attr/selectableItemBackgroundBorderless
æ®ãã®ã¢ã€ãã
ãããªã¢ã«ãã¶ã€ã³ãã¥ãŒã«æºæ ããèŠçŽ ã¯ãå¯èœã§ããã°ã»ã«ãµã€ãºã8dpã®ã°ãªããäžã«é 眮ããå¿ èŠããããŸãã ãã®ã¢ãããŒãã®ãããã§ãUI ã¯æ§é åãããŠæ¥œããããã«èŠããŸãã
ViewGroupèŠçŽ ïŒLinearLayoutãFrameLayoutãRelativeLayoutãªã©ïŒãžã®ãªã³ã¯ãå¿ èŠã§ããã®ç¹å®ã®ViewGroupã¿ã€ãã«ç¹å®ã®ã¡ãœãããå¿ èŠãªãå Žåã¯ãç¹å®ã®ã¿ã€ããä¿åããã ViewGroupã䜿çšããŸã ã
ãã®ä»ã®è³æ
- ããããã£ã¹ããèŽã
1. æçå
2. èå°è£ã®Androidéçºè
3. ãã·ã¢èªããããã£ã¹ã ïŒç¿»èš³è ããïŒ
ãããã¯æã人æ°ããããŸãããä»ã®ãã®ãèŠã€ããããšãã§ããŸãã
PSïŒç§ã¯Player.fmã䜿çšããŠããããã£ã¹ããèããŸãã ãŸããç¡æã®ã¢ããªããããŸãã
- å°é家ãšã®ç°¡åãªã¢ã³ããã€ããããªã€ã³ã¿ãã¥ãŒ ã
- ãªãŒãã³ãœãŒã¹ã®CodePath Android Cliffnotesã³ãã¥ããã£ã§ãµããŒããããŠããå€ãã®èšäº
Androidéçºè ã«ãšã£ãŠé¢å¿ã®ããã»ãŒãã¹ãŠã®ãããã¯ã«é¢ããå®å šãã€ææ°ã®æ å ±ãå«ãäžå åããããªãœãŒã¹ã - èäœæš©ã®äžè©±ããã
- æ°ããAndroidã©ã€ãã©ãªãã芧ãã ãã
Android Arsenal-䜿çšããå€ãã®ã©ã€ãã©ãªãå«ãAndroidéçºè åãã®ãªãœãŒã¹ - ãããªãã¯Androidã¢ããªã±ãŒã·ã§ã³ã®ãœãŒã¹ã調ã¹ãŠãã ããã
1. ããŸããŸãªã³ã³ããŒãã³ãã®æ§æã®å€ãã®åçŽãªåé¢äŸ ã
2. GoogleãæäŸããã¢ããªã±ãŒã·ã§ã³ã®äŸ ã
3. Google Android Codelabs
- ãã¬ãŒãã³ã°ã« Twitter ã䜿çšããŸãã
ããŸããŸãªäººæ°ã®ãããªãœãŒã¹ã§ãã©ãŠã¶ãŒãããã¯ããŒã¯ãã
- AndroidããããããŒ-Youtube
- Android Niceties-UIã·ã§ãŒã±ãŒã¹
- ææèšèšä»æ§
- ææèšèšã«é¢ãããã¹ãŠ
- ãã©ãããã©ãŒã ããŒãžã§ã³ã®é åž
- Android StudioãªãªãŒã¹ããŒã
- AndroidããããããŒããã°
- AndroidDev-Reddit
- Githubã®Javaãããžã§ã¯ãã®ãã¬ã³ã
- StackOverflow-Androidã¿ã°
- ãµããŒãã©ã€ãã©ãªã®å±¥æŽ
- Androidã«ã³ãã¡ã¬ã³ã¹
- Android Dev Docs
- çŽ æã¢ãã-DesignShowcase
- ããªãã«-MaterialDesignShowcase
ãã¹ãã«ã¯ç¡æã®æš¡æ¬APIã䜿çšããŸãã
以äžã«ãªã¹ããããã¹ãŠã®äŸã¯ãäœããã®åœ¢ã§ãããã¯ãšã³ããªãã§ã¢ããªã±ãŒã·ã§ã³ããã¹ãããããšãå¯èœã«ããŸãã 䜿çšããå¿ èŠãããå Žåã¯ããªã¹ãã調ã¹ãŠãæ©èœã®ããŒãºãšèŠä»¶ã«æãé©ããé ç®ã確èªããŠãã ããã
Androidéçºãã€ãžã§ã¹ãã«ãµã€ã³ã¢ãããã
- AndroidãŠã£ãŒã¯ãªãŒ -ãã¬ã³ããç¶æããæ°ãããã¯ãããžãŒã«ã€ããŠåŠã¶ããã®ç¡æãã€ãžã§ã¹ã
- AndroidDevDigest - AndroidDevDigestã®é±åãã¥ãŒã¹ã¬ã¿ãŒ
- Infinium AndroidSweets-ææ°ã®Androidãã¥ãŒã¹
- Kotlin Weekly-ç¡æã®Kotlinãã€ãžã§ã¹ã
ãã䟿å©ãªãœãããŠã§ã¢ã®äŸ
- Android SVGããVectorDrawable -SVGãããã¯ã¿ãŒãžã®å€æ
- SQLite Viewer -sqliteãã¡ã€ã«ããªã³ã©ã€ã³ã§è¡šç€ºã§ããŸã
- Android 9ãããã·ã£ããŠãžã§ãã¬ãŒã¿ãŒ-ã·ã£ããŠãå¯èœãªéãå®å šã«èªååã§ãããŠãŒãã£ãªãã£
- APKã¡ãœããã«ãŠã³ã -apkã§äœ¿çšãããŠããã¡ãœããã®æ°ã調ã¹ãã®ã«åœ¹ç«ã¡ãŸã
- ãããªã¢ã«ãã¬ãã -ãããªã¢ã«ã«ã©ãŒãã¬ãããçæ
- Javadoc Themer-éå±ãªjavaDocsãç°ãªãè²ã§è²ä»ãããŸãããïŒ
- ã¡ãœããæ° -ã©ã€ãã©ãªå ã®ã¡ãœããã®æ°ãç°¡åã«èªèãã65Kã®å¶éãè¶ ããªãããã«ããããã«äœ¿çšããŸãïŒ
- Gradleããé¡ã -gradleã¹ã¯ãªããã«æ¿å ¥ããã©ã€ãã©ãªåã§äŸåé¢ä¿ãæ€çŽ¢ããŸã
- jsonschema2pojo -jsonãŸãã¯jsonã¹ããŒãããPOJOãçæãã
- Android Asset Studio-ã¹ã¯ãªãŒã³ã·ã§ãããã¹ããŒããã©ã³ã®ãã¬ãŒã ã«ç°¡åã«ã©ããã§ããŸã
ããã«-ç§ãå人çã«éçºããAndroidã©ã€ãã©ãª
- EasyDeviceInfo-éçºè ãããã€ã¹ã«é¢ããæ å ±ãç°¡åã«åä¿¡ã§ããããã«ããŸã
- Sensey-ãžã§ã¹ãã£ãŒèªèã©ã€ãã©ãª
- PackageHunter-ããã€ã¹ã«ã€ã³ã¹ããŒã«ãããŠããã¢ããªã±ãŒã·ã§ã³ã«é¢ããæ å ±ãåä¿¡ã§ããŸã
- Zentone-é©åãªããŒã³ãç°¡åã«çæ
- RecyclerViewHelper-ããŸããŸãªãã«ããŒæ©èœãæäŸããŸã
- StackedHorizoâântalProgressbar-æ°Žå¹³ããã°ã¬ã¹ããŒ
- QREader -Google Mobile Vision APIã䜿çšããQRã³ãŒãã®èªã¿åãã®ç°¡çŽ å
- ScreenShott-ããã€ã¹ã®ã¹ã¯ãªãŒã³ã·ã§ãããããã°ã©ã ã§ååŸã§ããŸã
- EvTrack-ã€ãã³ããšãšã©ãŒã®è¿œè·¡ãç°¡çŽ åããã©ã€ãã©ãª
- OptimusHTTP-ãããã¯ãŒã¯ã®ç°¡çŽ å
- ShoutOut-ãã®ã³ã°ã©ã€ãã©ãª