<!--?xml version="1.0" encoding="utf-8"?-->
<resources>
<string name="hello">Hello World, HelloWorldActivity!</string>
<string name="app_name">01.HelloWorld</string>
<string name="myname">Lee1000</string>
<!-- 주석은 태그 밖에만 한다. -->
</resources>
package com.sogangori;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.Button;
public class HelloWorldActivity extends Activity {
//어플 실행시 호출
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Button btn = new Button(this);
btn.setText(R.string.myname); //리소스 사용
btn.setTextSize(23.23f);
btn.setTextColor(Color.BLUE);
btn.setBackgroundColor(Color.RED);
setContentView(btn);
//자원 resource 활용
}
}