µð¹ö±ë ÀÛ¾÷À» À§ÇØ "Hello World" ¹®ÀÚ¿ ¼öÁ¤°ú ¾Èµå·ÎÀÌµå ·Î±× Ãâ·Â¿¡ ´ëÇؼ ¾Ë¾Æº»´Ù.¾Èµå·ÎÀÌµå ½ºÆ©µð¿À¿¡¼ ÄÚµå·Î "Hello World!" ¹®ÀÚ¿ ¼öÁ¤1. app > res > layout > content_main.xmlÀ» Ŭ¸¯ÇÑ´Ù.2. ¸®¼Ò½º ÆíÁý±â¿¡¼ "Hello World!" ¹®ÀÚ¿À» ¼±ÅÃÇÑ´Ù. 3. ¿À¸¥ÂÊ ID Ç׸ñ¿¡ ÀÓÀÇÀÇ ID¸¦ ÀÔ·ÂÇÑ´Ù. (¿©±â¼´Â textView1¸¦ ÀÔ·ÂÇÏ¿´´Ù.) 4. ÄÚµå·Î ID¸¦ ã¾Æ¼ ¹®ÀÚ¿À» Ãâ·ÂÇÑ´Ù. import android.widget.TextView;
TextView textView1 = (TextView)findViewById( R.id.textView1 ); textView1.setText("~~~~~~Bye World~~~~~~~~"); LogcatÀ¸·Î ·Î±× Ãâ·Â¾Èµå·ÎÀÌ¿¡¼´Â android.util.Log·Î ·Î±×¸¦ Ãâ·ÂÇÑ´Ù.Log.e : °¡Àå ½É°¢ÇÑ ¹®Á¦°¡ ¹ß»ýÇßÀ»¶§ ³²±â´Â ·Î±× Log.w : ½É°¢ÇÏÁö´Â ¾ÊÁö¸¸ ³ªÁß¿¡¶óµµ ²À »ìÆ캸¾Æ¾ß ÇÒ ¹®Á¦°¡ ¹ß»ý ÇßÀ»¶§ ³²±â´Â ·Î±× Log.i : ¾î¶² 󸮸¦ ÇÏ¸é¼ ¹ß»ýÇÏ´Â ÁøÇà °úÁ¤ µîÀ» ¸ð´ÏÅ͸µÇϱâ À§ÇÑ ¸ñÀûÀ¸·Î ³²±â´Â ·Î±× Log.d : µð¹ö±ëÀÇ ¸ñÀûÀ¸·Î ¹®Á¦ ¹ß»ý °¡´É¼ºÀÌ ÀÖ´Â °÷¿¡ ³²±â´Â ·Î±× Log.v : µ¿ÀÛ ¿©ºÎ¸¦ ÃÖ´ëÇÑ ÀÚ¼¼È÷ »ìÆ캼 ¸ñÀûÀ¸·Î ³²±â´Â ·Î±× import android.util.*; Log.e("tag", "error message"); Log.w("tag", "warning message"); Log.i("tag", "information message"); Log.d("tag", "debugging message"); Log.v("tag", "verbose message"); Âü°í) http://promobile.tistory.com/63 |