æ¬ãµã¤ãã§ã¯ãµã¼ãã¹åä¸ã®ãããGoogle Analyticsãå°å ¥ãã¦ãã¾ããåæã«ã¯Cookieãå©ç¨ãã¦ãã¾ãã
getApplicationContext() is almost always wrong. Ms. Hackborn (among others) have been very explicit that you only use getApplicationContext() when you know why you are using getApplicationContext() and only when you need to use getApplicationContext(). To be blunt, "some programmers" use getApplicationContext() (or getBaseContext(), to a lesser extent) because their Java experience is limited. The
Starting with a recent new version of ADT, I've noticed this new attribute on the layout XML files, for example: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".MainActivity" /> What is "tools:context" used for
Android ã¢ããªã®éçºã§èµ·ããã¡ãªåé¡ãäºé²ããããã®ã³ã¼ãã¬ãã¥ã¼ã®ãã§ãã¯ãªã¹ãã§ãã ãã§ãã¯ãªã¹ãã®æ¹é 極åæ°å°ãªãé ç®ã§å¤ãã®åé¡ãé²ãããã¨ã è¦ã¯ãæä½éãããå®ã£ã¦ãããã¨ã¾ãã¾ã OK ã ã¨æãã¾ãããããã®ãã®ã§ãã é ç®ãå°ãªãã®ã§éè¦ãªäºæã«éä¸ã§ãã¾ããã¬ãã¥ã¯ã®çµé¨ãå°ãªã人ãã¨ã£ããããããã¨æãã¾ãã å ¨ä½çã«ãéçºçµé¨ãããã¾ã§è±å¯ã§ã¯ãªãæ¹åãã®ãã§ãã¯ãªã¹ãã«ãªã£ã¦ããã¨æãã¾ãã å ¨4é ç®ã§ãã 1. ãªãã¹ã Activity ã«ãã£ã¼ã«ãã§ãã©ã°ãæãããªãã㨠ãããã¹ãçç± äºæ³å¤ã®ãã°ãçºçããã®ãæ¸ããããã§ãã ä¸è¨ã®ç¶æ³ã«é¥ãã¨åé¡ãçºçããã®ã§ããããåé¿ãã¾ãã è²ã ãªç®æã§è²ã ãªãã©ã°ãå¤æ´ãã¦ãã¦ã©ãã§ä½ããã¦ããããææ¡ã§ãããå®è£ æã«ãã©ã°ã®æä½æ¼ããçºçãã è¤æ°ã®ãã©ã°ã®çµã¿åããã§æåãå¤åããããã«ãªã£ã¦ã
1. æ¦è¦ Android Support Library ã®ãã¼ã¸ã§ã³ 24.2.0 ããªãªã¼ã¹ããã¾ãããããã®ãã¼ã¸ã§ã³ãã v4 Support Library ãåå²ããããã®ã使ããããã«ãªãã¾ããã åèï¼Support Library Features 以ä¸ã® Library 群ã¨ãã¦æä¾ããã¦ãã¾ãã support-compat support-core-ui support-core-utils support-fragment support-media-compat ã¨ã¯ãããSupport Library 群ã§æã大ããã£ã v4 ãªã®ã§ãã©ã®ã©ã¤ãã©ãªã«ä½ãããã®ãåãããªãã®ãä¸ä¾¿ã ã£ãã®ã§ã調ã¹ã¦ã¿ã¾ããã 2. ããã±ã¼ã¸æ§æ support-compat android.support.v4.accessibilityservice android.s
ã¿ã¤ãã«ã¯èªå¼µã§ãã ã¿ããªå¤§å¥½ãpotatotipsã¨ããåå¼·ä¼ã§ä»¥ä¸ã®ãããªãã¼ã¯ããã£ãããã§ãã(ç¾å ´ã«ã¯è¡ã£ã¦ãã¾ãã) æ°ããActivityContextã§ä½ååããã£ããæ°åãªã¼ã¯ãæ¤åºãããã ãªãã¹ãApplicationContextã使ãããã¨ã®ãã¨ãããã§ãããééããªãæ»äººãåºã(èªå¼µ)ã¨æãã¾ãã®ã§ã注æãã ããã (追è¨20160527: ä¿®æ£ãããããã§ã ãªãããã¿ã¾ãã) speakerdeck.com çµè« Application Contextã¯ä½¿ããªãã§ãã ããã(èªå¼µ) (å®éã¯ä½¿ãã¨ãã¯ä½¿ã) ãªãApplication Contextãªã®ã Application Context使ããã!ã¨ããæ ¹æ ã®è¨äºã¨ãã¦ãã¡ãã®ãã§ã³ãªã«ã®Developer's Blogã® [追è¨ãã] Android éçºã§æ°ãã¤ãããã㨠ãå¤æ°å㨠Conte
#ç»åã®ä¸æä¿åã®æ¹æ³ ç»åå¦çããã¢ããªãä½æããå ´åã ã«ã¡ã©ãã®ã£ã©ãªã¼ã§åãè¾¼ãã å ã®ãã¼ã¿ãä¸æçã«ãã£ã¦ããããæãããã¾ãã ãã®ã¨ãã¡ã³ãã¼å¤æ°ã«Bitmapããã£ã¦ããã¨ãããç¨åº¦ã§ããç»åããã£ã¦ãã㨠ããã«OutOfMemoryãããã¦ãã¾ãã¾ãã ãã¾ã¾ã§ã«ä¸æçã«ãã¼ã¿ãä¿æããæ¹æ³ããããã試ããã®ã§ã¡ã¢ãã¦ããã ã¡ã³ãã¼å¤æ° ã¡ãªãã ç°¡å ãã¡ãªãã ã¢ã¯ãã£ããã£çµäºããããããã ã¡ã¢ãªã«ãããããªã ã³ã¼ã private Bitmap cache; ãã¡ã¤ã«ã«æ¸ãåºã ã¡ãªãã -ã¡ã¢ãªåªãã ãã¡ãªãã æ®ã£ã¦ãã¾ã£ãæã«ãã®ã£ã©ãªã¼ã§è¡¨ç¤ºããã¦ãã¾ã ###ã³ã¼ã try { // sdcardãã©ã«ããæå® File root = Environment.getExternalStorageDirectory(); // æ¥ä»ã§ãã¡ã¤ã«åã
getFilesDirã§åå¾ã§ããPath以ä¸ã«ãã¡ã¤ã«ãä½æããã第1å¼æ°ã«ãã¡ã¤ã«åã第2å¼æ°ã«ã¢ã¯ã»ã¹ã¢ã¼ããæå®(MODE_PRIVATEãä¸è¬ç)ããã Activityã¯ã©ã¹ã®getFilesDirã¡ã½ãããgetCacheDirã¡ã½ããã使ãã¨ç«¯æ«ã§æå®ããã¦ããã¢ããªã±ã¼ã·ã§ã³å°ç¨ã®ãã¼ã¿é åãåå¾ã§ãã¾ãã ãã°ã«ãã¹ãåºåããã ãã®ç°¡åãªãµã³ãã«ã³ã¼ããç¨æãã¾ãããå®è¡ãã¦ãã«ãã¦ã¼ã¶æã®æåã確èªãã¦ã¿ã¾ãããã //ã¢ããªã±ã¼ã·ã§ã³å°ç¨ãã¼ã¿é å //ãã¡ã¤ã«ä¿åãã£ã¬ã¯ã㪠Log.d("Multi", " getFilesDir(): " + getFilesDir()); //ãã£ãã·ã¥ä¿åãã£ã¬ã¯ããª(æ¶å»ãããå¯è½æ§ãã) Log.d("Multi", " getCacheDir(): " + getCacheDir()); â»ã¡ãªã¿ã«CacheDirã¯
Androidã§ä»ã®ã¢ããªã«ä½ãå¦çãæãããã¨ãã«ã¯ãIntentã¨ãããã®ã使ãã æ示çIntentã¨æé»çIntentã¨ãããã®ããã£ã¦ãæ示çIntentã¯å¼ã³åºãããActivityã®Classãç´æ¥æå®ããã æé»çIntentã¯å¼ã³åºãããActivityï¼ã¨ãããã¢ããªï¼ã®ç¨®é¡ããã©ããããã¨ããã¦ã»ãããã¨ãã£ããã¨ãè¨å®ãã¦æããã¨ã俺ããåºæ¥ããï¼ãã£ã¦ã¢ããªãæ å½ãã¦ãããã ã¨ãããã¨ã¯è¯ãç¥ããã¦ããã¨ã§ãé »ç¹ã«ä½¿ããã¨ãªãã ãã©ãèªåã§ä½ã£ããä¿åããç»åãä»ã®ã¢ããªã«æ¸¡ãããã¨ãã«ãIntentã«ç»åãæå®ããæ¹æ³ã§ããã£ãã ããããªæ¹æ³ãã¤ã³ã¿ã¼ãããã«ä¹ã£ã¦ããã©ãIntentãåãåã£ã¦ã¯ããããã®ã®ç»åãèªã¿è¾¼ããªãã§ä¸æ£çµäºãã¦ãã¾ããªãã¦ãã¨ãããåã£ãã ããã©ã«ãã®ã®ã£ã©ãªã¼ãGoogle謹製ã®ãã©ããªãããã¨ã©ã¼è½ã¡ãã¦ãã¾ãã¨ãããã¨
ç¿æ³³ç¤¾ã§ã¯ã4æããåãçµãã§ãããã¸ã¿ã«ãã¡ã¼ã¹ãã®ç¬¬ä¸å¼¾ã¨ãã¦ãæè¡ç³»å人èªãå¶ä½ãã¦ããTechBoosterã®å人èªãåºçãã¾ãããä»åãããã¸ã§ã¯ãå§åãè¨å¿µãã¦ä»£è¡¨ã®æ¥é«æ£åããã¨CodeZineç·¨éé·ã®ææ¨ã«ãã対è«ãå®æ½ãTechBoosterã§ã®å¶ä½ææ³ããåºç社å´ã®æå³ãæããã«ãªãã¾ãã ç¿æ³³ç¤¾ã§ã¯ããã¸ã¿ã«ãã¡ã¼ã¹ããã¨ããããã¸ã§ã¯ãã4æããå§ãã¾ãããããã¯æµè¡ããã¾ã®ãã¼ãºã«åãããæ¸ç±ãããããªãã¼ãã ããã©åºãç¥ããã価å¤ã®ããæ¸ç±ããããã¯æ¢åæ¸ç±ã®ã¯ã¤ãçãªã©ãããå¤ãã®æ¹ã«æã«åã£ã¦ããã ãããã«ãã¾ãé»åæ¸ç±ãPODï¼Print On Demandã注æãã¨ã«å°å·ããå½¢å¼ï¼ã§åºçãã¦ãããã¨ããåãçµã¿ã§ãã CodeZineã§ã¯ãæè¡ç³»å人èªãå¶ä½ããã¦ãããµã¼ã¯ã«ã»TechBoosterããæ¢åã®ãAndroidå®è·µããã°ã©ãã³ã° ç¾å ´ã§çã¾
Javaã®è©±ã¯ããããããã¨æãã¾ãããAndroidéçºã極ãã¦ããã«ã¯ã©ãããããããã¨ãã話ãåãåºãã¦ã¿ããã¨æãã¾ãã éçºå ¥éåãã®ã¬ã¤ãã¯ãããã® https://github.com/mixi-inc/AndroidTraining ãããã®ã§ãããå®è·µçãªå 容ãã©ãããããã¨ãã話ã«ãã©ã¼ã«ã¹ãã¾ãã Androidãªãã¶ã¤ã³ã¨éçº Material Designã®ã¬ã¤ãã©ã¤ã³ Googleãèããæå¼·ï¼ï¼ï¼ã®ãã¶ã¤ã³ã¬ã¤ãã©ã¤ã³ãããããããªã¢ã«ãã¶ã¤ã³ã§ãã https://www.google.com/design/spec/material-design/introduction.html 使ãã¹ãUIé¨åããªã¹ã表示ã®ã¬ã¤ã¢ã¦ãããã¤ã¢ãã°ã使ãã¿ã¤ãã³ã°ã¨è¡¨ç¤ºå 容ãé·ç§»ã¢ãã¡ã¼ã·ã§ã³ã®ä½¿ãæ¹ãªã©å¤å²ã«æ¸¡ãã¾ãã ãã®å 容ã«æ²¿ã£ã¦éçºããã¨ããªãã¢ãã³ãªAndr
åç½®ã Androidã®SharedPreferencesã¯æ°¸ç¶çãªãã¼ã¿ãè¨å®å¤ãªã©ãä¿åããããã«ä½¿ãã å®ãã¡ã¤ã«ã¨ãã¦/data/data/[ããã±ã¼ã¸å]/shared_prefs/以ä¸ã«xmlå½¢å¼ã§ä¿åãããã ãã£ã¦ãã¡ã¤ã«IOãçºçããã®ã ããå®éã«ã©ã®ã¿ã¤ãã³ã°ã§èªã¿æ¸ããçºçãã¦ããã®ãã調æ»ããã¢ããªã®æé©åã«å½¹ç«ã¦ãã ç°å¢ 主ã«Android5.1.0ã®ã³ã¼ãã§ç¢ºèª SharedPreferencesã®ã¡ã¢ãªãã£ãã·ã¥ SharedPreferencesã®å®æåé¨åã¯SharedPreferencesImplã«å®è£ ããã¦ããã ãã®ä¸ã®ãã£ã¼ã«ãã®ä¸ã¤ã«private Map<String, Object> mMap;ãããããã¹ã¦ã®Key-Valueã®çµã¯xmlãã¡ã¤ã«ã¨ã¯å¥ã«ã¡ã¢ãªä¸ã§ã管çããã¦ãããã¨ã«ãªãã æ¸ã込㿠SharedPreferencesã¸
Android Javaã§ã¯æããAOSPã®coding style guidelineã«åã£ãã¹ã¿ã¤ã«ãã¨ããããã¨ãå¤ãããã§ãããã®ãªãã§ãprivate fieldã« "m" (member) ã "s" (static member) ãªã©ã®ãã¬ãã£ã¯ã¹ãã¤ãããã¨ãããã®ãããã¾ãã AOSP Java Code Style for Contributors  | Android Open Source Project ããã¯ãããããã³ã¬ãªã¢ã³è¨æ³ã®å¤ç¨®ã§ããããããã¤ã§ããã class Recipe { private String mTitle; private List<String> mSteps; // ... } ããã«ã¤ãã¦ã®æ 度ã¯ããã¸ã§ã¯ããã¨ã«æ§ã ã§ããããã¨ãã°ã¯ãã¯ããã社ã®Javaã®ã¹ã¿ã¤ã«ã¬ã¤ãã§ã¯æ確ã«å¦å®ãã¦ãã¾ãã styleguide/
ã¯ããã« Android SDK ã«ã¯ãé¢åã§ãã£ãããåé·ã«ãªããã¡ãªå¦çãè¡ãªã£ã¦ããã Util ã¯ã©ã¹ãæ°å¤ãåå¨ãã¾ãã æå¤ã¨ç¥ããã¦ããªã便å©ãª Util ã¯ã©ã¹ãããã¾ãã ã¨ãããã¨ã§ãAndroidã¢ããªãéçºããä¸ã§ãã²ä½¿ã£ã¦ãããã便å©ãª Util ã¯ã©ã¹ãã¾ã¨ãã¾ããã TextUtils Linkify DateUtils Formatter Pair SparseArray FloatMath Color ThumbnailUtils TextUtils http://developer.android.com/reference/android/text/TextUtils.html String ã® Util ã¯ã©ã¹ã§ãã isEmpty 㯠String ã® null 㨠length = 0 ãã¾ã¨ãã¦ãã§ãã¯ãã¦ããã¾ãããã®ãããã¯ããå¿ è¦ã«ãªãã
æåã« æ¬æ¥ã¯@takahiromãããæ¸ãæ¥ã ã£ãã®ã§ãããããåã¾ã£ã¡ãã£ããï¼ã¨å»ãã§ãããæ ãããã¾ãããæ¬å½ã«ãããã¨ããããã¾ããï¼ @takahiromããã¨ã¯ããåå¼·ä¼ã§ãä¼ãããã®ãæ©ã«PreLollipopTransitionãªã©ã§çµ¡ã¿åºããç¸ã§ä»²è¯ãããã¦é ãã¦ãã¾ãã@takahiromããã®è¨äºãæå¾ ãã¦ããæ¹ã¯ãã¡ãã¸ãã¾ãããã ããã ããããèª°ï¼ æ¬é¡ã«å ¥ãåã«ããããããå誰ã ï¼ãªãã§APTãèªãï¼ã£ã¦äººãå¤ãã¨æãã®ã§ãèªå·±ç´¹ä»ããã¦ä¸ããã Annotation Processing Tool(ã¾ãã¯APT)ã§ã®ã³ã¼ãèªåçæã好ãéãã¦èªä½ã®ã¹ãã¼ããã¿ã¼ã³ç¨APTã©ã¤ãã©ãªãå ¬éããã ãã§ã¯é£½ãããããAndroidã©ã¤ãã©ãªã§Annotationã¨ããã°ãAndroidAnnotations(AA)ã§ããã£ã¦ãã¨ã§ãPRãæãå§ãã¾ãããã¤ããã£
ã¢ãã¤ã«DevOpsã«ã¬ã³ãã¼ã®2æ¥ç®ã§ãã ãä»äºã§ã¯ Android ãæ¸ãã¦ããã®ã§ã Android ã® DevOps ã«ã¤ãã¦æ¸ããã¨æãã¾ãã éçºã¨éç¨ã®è¦ãã¿ ä¸æ¥ç®ã« tnj ãããæ¸ãã¦ãã ããã¾ããéãã ã¢ãã¤ã«ã®éçºã»éç¨ãããä¸ã§ãæã ã¨ã³ã¸ãã¢ãç®æãã¨ãããããã¾ãã å ¨ã¦ã® 人éã«é ¼ãã解決ã§ããä»äº ãçã¾ããåã«æ¶ãå»ãããã æã éçºè ã¯ããªããæ¥ã è¦å´ãã¦ã³ã¼ããçç£ãã¦ãã¾ãã ããã¦ãã®ã¡ã®ã¡ã«ãã®ã³ã¼ãã®ã¡ã³ããã³ã¹ã§è¦ããç¾½ç®ã«ãªãã¾ãã è¦ããæãã¯ããããªãï¼ï¼ ä½ãæã ãè¦ããããã ï¼ï¼ï¼ï¼ï¼ æã ãæ¸ããã³ã¼ã ã ï¼ï¼ï¼ï¼ ã¨ãªãã°ãããã ã¡ã³ããã³ã¹ãã¹ãã³ã¼ãããªããã°è¦ãã¾ãã«æ¸ã ã®ã§ãï¼ äººéãæ¸ãã¦ç®¡çããã³ã¼ããæ¸ãã°ããï¼ ã§ããããã¯ããåºæ¥ä¸ãããªãã¨ã客æ§ã«ä¾¡å¤æä¾ãªãã¦ã§ããªãï¼ åå ¥ããªããçãã¦è¡ããªã
ã¡ãã£ã¨ã§ãJava7ãªAndroidãæ°æã¡ããããã°ã©ãã³ã°ãããã Javaã£ã½ã(?)ã¨ãããããã¤ã¤ãã¢ãã³ãªãã©ãã¤ã ãåãå ¥ãããã¦ããScalaã羨ã¾ããè¦ããã®ã§ãScalaã£ã½ãæ¸ãããã¨ããæå¿ããæ¸ãã¦ãã¾ã ãµã³ãã«ã³ã¼ãã§ã¯ç´é¢ã®é½åä¸ãretrolambdaã§lambdaå¼ä½¿ã£ã¦ãã¾ã Scalaã®ç¾¨ã¾ããã¨ãã æããã°ããªãç¡ãã§ããã以ä¸ã¨ãã¾ã é¢æ°åããã°ã©ãã³ã° å¼·åãªå¼ é¢æ°åããã°ã©ãã³ã°ã£ã½ã ããã«ã¤ãã¦ã¯Roppongi.aar #2 - connpassã§ç§ãçºè¡¨ããå 容ããã¼ã¹ã¨ãªã£ã¦ãã¾ã OOãªjavaã§ç¡çãã¦é¢æ°åããã°ã©ãã³ã°ãç®æãã®ã§ã¯ãªããé¢æ°åããã°ã©ãã³ã°ã®ä¸ã§ãã¢ããã¨ãããã便å©ãªãã¼ã¿æ§é ã便å©ã«ä½¿ããããã¨ãã£ãç¨åº¦ã®ãã®ã§ã ããã§ãAndroidã§ãã¢ããå®è£ ãã¦ä½¿ãã°æ°æã¡ããããããªãããã¨ãããã¨
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}