안녕하세요 안드로이드 강좌를 시작하게된 Shin 입니다.


res/layout/activity_main.xml

<linearlayout 
	xmlns:android="http://schemas.android.com/apk/res/android" 
	android:layout_width="match_parent" 
	android:layout_height="match_parent">
<textview 
	android:id="@+id/calculator" 
	android:layout_width="fill_parent" 
	android:layout_height="wrap_content" 
	android:text="@string/hello_world" 
	android:textappearance="?android:attr/textAppearanceLarge">
</textview>
</linearlayout>


자바파일 내용은~

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}
}


이렇게만 수정해도 hello world 가 찍히네요

LinearLayout 은  좌에서 우 , 위에서 아래로 추가되는 틀이 만들어집니다.

기본으로 위에서 아래로 됩니다.

만약 명시적으로 지정하시고 싶으시면   android:orientation 속성으로 지정하시면 됩니다.  값은 vertical , horizontal 이 있습니다.

horizontal 은 좌에서 우로 vertical 은 위에서 아래로입니다.


그럼 실행해볼까요?

우선 휴대폰을 셋팅합니다~

설정 > 개발자옵션 > 개발자옵션 ON > USB디버깅 켜기 > USB디버깅 허용 확인




설정이 끝났다면 실행을 합니다. 

프로젝트를 선택하고 Run As > Android Application 을 선택합니다.

위에설정을 하고  usb연결을 해두었다면 아래와 같이 단말이 보입니다.



실행결과 화면 ~


예제 프로젝트입니다. 

ShinExample.zip



Posted by App.SHIN
:

BLOG main image
by App.SHIN

공지사항

카테고리

분류 전체보기 (27)
안드로이드 (12)
추천앱 (0)
맛집 (0)
영화 (0)
핫이슈 (2)
서버 (2)
mac os 적응기 (8)
java (1)
mysql (1)
tomcat (1)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

달력

«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Total :
Today : Yesterday :