2014년 3월 13일 목요일

RSA/RAD 9 ( eclipse Juno 기반 ) 에 EGit 설치 하기

RSA / RAD는 Eclipse 4.2 Juno 기반이다.
그리고, EGit는 mylyn 을 참조하지만 RSA/RAD에는 설치 되어 있지 않아  EGit가 바로 설치 되지 않는다.

따라서 Mylyn을 먼저 설치 하고 EGit를 설치 해야 한다.

Help > Install New Software ...

Mylyn update site : http://download.eclipse.org/mylyn/releases/latest

EGit update site : http://download.eclipse.org/egit/updates

2013년 11월 7일 목요일

byte[] 를 String으로 변환 할 때 마지막 글자가 ?로 될 때

한글은 두바이트 글자이므로 byte로 변환을 하면  0보다 작은 같이 된다. 
따라서 변환전에  마지막  byte 부터 0보다 작은 값의 수가 짝이 맞는지 검사 하여 변환 길이 값을 조절 하면 된다. 

int cnt=0;
for( int i=len-1; i >= 0 ; i-- ){
if( b[i] < 0 ) cnt++;
else break;
}
if( cnt % 2 == 0)
str = new String( b, 0, len, "euc-kr"); // 짝이 맞으면 길이대로 변환 
else

str = new String( b, 0, len-1, "euc-kr"); // 짝이 맞지 않으면 마지막 byte는 버린다. 


* 변환된  string의 마지막 char가 ? 인지 검사하는 방법은 무슨 이유인지 동작하지 않음.

str.charAt( str.length() - 1 ) == '?' ==> false 
str.substring( str.length() - 1).equals("?") ==> false 

--------
테스트 코드 ( Java 1.6으로 테스트 함 )
--------
public class EncTest {

public static void main(String[] args) throws Exception{
String str = "한글테스트;";
byte[] b = str.getBytes("euc-kr");
System.out.println(b.length);
printByte( b );
for( int len = 10; len > 7 ; len--){
int cnt=0;
for( int i=len-1; i >= 0 ; i-- ){
if( b[i] < 0 ) cnt++;
else break;
}
if( cnt % 2 == 0)
str = new String( b, 0, len, "euc-kr");
else
str = new String( b, 0, len-1, "euc-kr");
System.out.println(str.length()+":"+str+":"+str.getBytes().length);
printByte(str.getBytes() );
}

}

private static void printByte( byte[] data ){
int i=0;
for( byte b : data){
System.out.printf("%d : %d %x; ",i++,b,b);
}
System.out.println();
}
}

2013년 7월 30일 화요일

sqlplus 실행 로그 남기기 - script 실행 결과 로그 남기기


spo c:\temp\spo.log

@c:\sql\test.sql
 ...
 spo off


이렇게 하면 c:\temp 폴더에 spo.log 파일이 생기며, 그 안에 test.sql의  실행 결과가 있다.

2013년 7월 23일 화요일

Websphere Application Srever 8.5 에 JDK 7 설치 하기

참고 : http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.installation.base.doc%2Fae%2Ftins_installation_jdk7.html

IBM Installation Manager를 통해서 설치 한다.
  1. 저장소에 아래 URL을 추가 한다.  
    http://www.ibm.com/software/repositorymanager/com.ibm.websphere.IBMJAVA.v70 
  2. 설치를 선택한다.
  3. 기존패키지를 WAS 8.5 선택, 해당 SDK 버전을 설치 한다. 
  4. managesdk를 이용하여 sdk 버전을 변경 한다. 
> managesdk -listAvailable
CWSDK1003I: 사용 가능한 SDK:
CWSDK1005I: SDK 이름: 1.6_64
CWSDK1005I: SDK 이름: 1.7_64


> managesdk  -enableProfileAll -sdkName 1.7_64
CWSDK1017I: AppSrv01 프로파일에서 이제 SDK 1.7_64을(를) 사용할 수 있습니다.
CWSDK1017I:
AppSrv02 프로파일에서 이제 SDK 1.7_64을(를) 사용할 수 있습니다.
CWSDK1001I: 요청된 managesdk 태스크를 수행했습니다.


※ WAS 시작로그에 아래처럼 Java version이 1.7.0으로 나오면 성공 !!!

************ Start Display Current Environment ************
WebSphere [IBMJAVA7 7.0.4.1 gm1318.03]Platform 8.5.5.0 [BASE 8.5.5.0 gm1319.01] running with process name kr900963Node02Cell\kr900963Node02\server1 and process id 36744
Host Operating System is Windows 7, version 6.1
Java version = 1.7.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM

2013년 4월 19일 금요일

WebSphere 서버이름 가져오기

jar : WebSphere/AppServer/plugins/com.ibm.ws.runtime.jar

class : com.ibm.websphere.runtime.ServerName

api

ServerName.getFullName() - cell , node 이름이 포함된 전체 이름
ServerName.getDisplayName() - cell , node 이름은 제외된 서버 이름
ServerName.getjsabpref() - z/WAS 인 경우 servant ID ( job id )

2012년 8월 10일 금요일

Eclipse 4.2에 RTC 4.0 설치 하기

RTC 4.0은 eclipse 3.x 를 기반으로 하기 때문에 IBM install manager로는 설치 되지 않는다.

참조 :
http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0/topic/com.ibm.jazz.install.doc/topics/t_client_installation_p2.html


  1. p2 설치를 위해 RTC의 p2 설치 zip 파일을 다운 받는다. 
  2. eclipse의 help -> Install New Software 
  3. Add
  4. Archive 선택. p2 zip 파일을 지정 하고 설치 한다.

2012년 7월 27일 금요일

JDBC type 2 WAS Multiple Row Fetch 옵션 설정 - JDBC Tuning

http://www.ibm.com/developerworks/data/library/techarticle/dm-0909rowsetdb2zos/index.html

WAS에서 사용하는 DB어플리케이션은 JDBC를 사용한다. 그런데...

WAS의 Data source는 DB2 JDBC Driver에서 제공하는 클래스를 어플리케이션에게 return하지 않고, wrapping된 클래스를 return하므로  아니기 때문에 sample code처럼 data source에 직접 설정할 수 없다. 그렇다고 WAS에 보여지는 기본 data source property 에도 사용할 수 있는 property가 없다.

그러므로 WAS의 data source 사용자 정의 특성에 추가 별도로 추가 해 주어야 한다.

데이터 소스 > my data source > 사용자 정의 특성

새로작성

    이름 : enableRowsetSupport
        값 : 1
     유형 : java.lang.Integer


    이름 : fetchSize
        값 : 100
     유형 : java.lang.Integer

fetchSize는 해당 데이터 소스를 사용하는 모든 sql에 적용되므로 개별적으로 적용을 하고자 할 경우엔 프로그램에서 setFetchSize()를 사용해서 statement에 지정해야 한다. 

※ enableRowsetSupport 를 disable 할 경우엔 값을 2를 사용한다.

2012년 7월 2일 월요일

우분투 12.04 업그레이드 후 network ( eth0 ) 이 동작 하지 않음.

배포판 업그레이드 후 리부팅 까지 완벽하게 되었으나
네트워크 연결이 되지 않음.

ifconfig로 확인해 보니 eth0 가 보이지 않았으며
dmesg 상으로는 정상적으로 인식한 걸로 보임.

/etc/network/interfaces 파일에 보니 loopback만 잡혀 있음.

auto lo
iface lo inet loopback
post-up /usr/bin/sendmail.pl

그래서 eth0를 추가함.

auto eth0
iface eth0 inet dhcp
그리고 networking을 재 시작 함.
/etc/init.d/networking stop
/etc/init.d/networking start
ifconfig로 eth0가 올라오고 ip가 할당된 것을 확인 함. ^^



2012년 6월 14일 목요일

JAX-RPC 와 JAX-WS 동시에 사용하기

동시에 여러개의 WebService를 호출하는 경우, 또한 서비스간 데이터를 주고 받아야 하는 겨우 Java로 메소드 호출 하듯이 A 서비스에서 가져온 결과를 B 서비스의 호출 인자로 넘겨 주고 싶은 경우가 있다.

아마도 BPM에서 backend의 여러 시스템에서 제공하는 서비스를 조합하고자 하는 경우 이런 일들이 발생할 텐데, IBM BPM 에서 테스트 해본 결과
  • JAX-RPC 는 package 구조로 xsd의 namespace를 생성한다. 
  • JAX-WS는 서비스의 package 구조로 xsd의 namespace를 생성한다. 
  • JAX-WS는 parameter를 wrapping한 데이터 구조를 더 생성한다. 
 namespace가 일치 하지 않으면 xsd로부터 만들어지는 Business Object는 호환이 되지 않는다.

따라서 JAX-WS로 생성할 parameter object에 annotation으로 namespace를 지정해 주면 동일한 namespace의 xsd를 생성할 수 있다.

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Customer", namespace = "http://bo.demo.bizhub.ibm.com")
public class Customer {

    long customerId;
...


2012년 1월 31일 화요일

Java 1.5 이상에서 ProcessBuilder를 이용해서 외부 프로그램 호출하기

Java 1.5부터 Runtime.exec()를 대신할 ProcessBuilder가 생겼다.

WAS에서 배치 프로그램을 시작할 수도 있고,
다른 시스템 프로그램을 호출 할 수도 있다.

아래 코드는  main() 메소드를 가지고 있는 자바 클래스를 실행하는 코드다.
실행 명령은 기존의 Runtime.exec와 다르게 명령행을 내용을 한 줄로 만드는 것이 아니라
space로 구분되는 내용을 각각의 문자열로 지정해야 한다.
아래 ProcessBuilder의 내용은 "java test.Callee a b=b c" 이렇게 명령행을 입력 하는 경우이다.
 // 각각의 command line argument까지 개별 항목으로 지정해야 한다.
 ProcessBuilder pb = new ProcessBuilder("java","test.Callee","a", "b=b" ,"c");
 Map env = pb.environment();
 // -classpath옵션은 ProcessBuilder에 직접 지정할 수 없다.
 // shell script를 만들때 처럼 환경 변수 CLASSPATH로 클래스 path를 지정한다.
 env.put("CLASSPATH", "C:/workspace/Test/bin");
 pb.directory(new File("C:/workspace/Test")); // 로그 파일이 생기는 기본 위치
 File log = new File("log"); // 로그 파일명
 pb.redirectErrorStream(true); // 에러도 로그에 출력되게 설정
  // redirectOutput과 Redirect는 java se 7 에서 추가된 내용 임. 
 pb.redirectOutput(Redirect.appendTo(log)); // System.out이 이 파일에 쓰여진다.
 Process p = pb.start(); // 프로그램을 실행한다.

위의 코드는 프로그램을 실행하고 바로 return 되는 코드다.

프로그램을 실행하고 끝날때 까지 기다리기를 원하면 p.waitFor();를 호출 한다.
이런 경우는 아래처럼 별도의 로그 파일을 쓰지 않고 직접 출력 할 수도 있다.

  ProcessBuilder pb = new ProcessBuilder("java","test.Callee","a", "b=b" ,"c");
  Map env = pb.environment();
  env.put("CLASSPATH", "C:/workspace/android/Test/bin");
  Process p = pb.start();
  p.waitFor();

  InputStream i = p.getInputStream();
  byte b[] = new byte[8192];
  int read=0;
  while( (read = i.read(b)) > 0 ){
   System.out.println("out : "+new String(b,0,read));
  }
  i= p.getErrorStream();
  while( (read = i.read(b)) > 0 ){
   System.out.println("err : "+new String(b,0,read));
  }
  System.out.printf("exit value : %s\n",p.exitValue()); // 0 이면 정상종료

간혹 명령이 잘못 되면 pb.start()에서 에러가 발생하기도 한다. 헌데, windows에서는 exception의 메시지에 포함된 한글이 깨지기도 한다. 이런경우 encoding값을 직접 지정하여 한글 메시지를 확인 하는 것이 도움이 된다. 또는 로그파일을 쓰면 된다.

 try {
  ProcessBuilder pb = new ProcessBuilder("java","test.Callee","a", "b=b" ,"c");
  Map env = pb.environment();
  env.put("CLASSPATH", "C:/workspace/android/Test/bin");
  Process p = pb.start();
  p.waitFor();
  InputStream i = p.getInputStream();
  byte b[] = new byte[8192];
  int read=0;
  while( (read = i.read(b)) > 0 ){
   System.out.println("out : "+new String(b,0,read));
  }
  i= p.getErrorStream();
  while( (read = i.read(b)) > 0 ){
   System.out.println("err : "+new String(b,0,read));
  }
  System.out.printf("exit value : %s\n",p.exitValue());
 } catch (IOException e) {
  try {
   System.out.println(
          new String( e.getMessage().getBytes("8859_1"), "euc-kr"));
  } catch (UnsupportedEncodingException e1) {
    e1.printStackTrace();
  }
  e.printStackTrace();
 } catch (InterruptedException e) {
  e.printStackTrace();
 }

2011년 9월 5일 월요일

JDBC 4.0 Driver 자동 로딩 사용하기


META-INF/services/java.sql.Driver 파일을 만든다. 

파일의 내용에 driver 클래스 이름을 적어 준다. 

ex) com.ibm.db2.jcc.DB2Driver

 

java.sql and javax.sql Features Introduced in the JDBC 4.0 API

  • auto java.sql.Driver discovery -- no longer need to load a java.sql.Driver class via Class.forName
  • National Character Set support added
  • Support added for the SQL:2003 XML data type
  • SQLException enhancements -- Added support for cause chaining; New SQLExceptions added for common SQLState class value codes
  • Enhanced Blob/Clob functionality -- Support provided to create and free a Blob/Clob instance as well as additional methods added to improve accessiblity
  • Support added for accessing a SQL ROWID
  • Support added to allow a JDBC application to access an instance of a JDBC resource that has been wrapped by a vendor, usually in an application server or connection pooling environment.
  • Availability to be notfied when a PreparedStatement that is associated with a PooledConnection has been closed or the driver determines is invalid

2011년 9월 1일 목요일

pivot / unpivot query

http://it.toolbox.com/blogs/db2luw/pivot-query-12757

http://it.toolbox.com/blogs/db2luw/unpivot-query-12798

CREATE TABLE Sales (Year INT, Quarter INT, Results INT)


YEAR QUARTER RESULTS 
----------- ----------- ----------- 
2004 1 20 
2004 2 30 
2004 3 15 
2004 4 10 
2005 1 18 
2005 2 40 
2005 3 12 
2005 4 27
 
SELECT Year,
MAX(CASE WHEN Quarter = 1
THEN Results END) AS Q1,
  
MAX(CASE WHEN Quarter = 2
THEN Results END) AS Q2,
  
MAX(CASE WHEN Quarter = 3
THEN Results END) AS Q3,
  
MAX(CASE WHEN Quarter = 4
THEN Results END) AS Q4 
FROM Sales 
GROUP BY Year
 
YEAR Q1 Q2 Q3 Q4
----------- ----------- ----------- ----------- ----------- 
2004 20 30 15 10 
2005 18 40 12 27
 
 
CREATE TABLE SalesAgg
( year INTEGER,
q1 INTEGER,
q2 INTEGER,
q3 INTEGER,
q4 INTEGER );
 
YEAR Q1 Q2 Q3 Q4 
----------- ----------- ----------- ----------- ----------- 
2004 20 30 15 10 
2005 18 40 12 27
 
SELECT S.Year, Q.Quarter, Q.Results 
FROM SalesAgg AS S, 
  TABLE (VALUES(1, S.q1),
(2, S.q2),
(3, S.q3),
(4, S.q4))
AS Q(Quarter, Results);
 
YEAR QUARTER RESULTS 
----------- ----------- ----------- 
2004 1 20 
2004 2 30 
2004 3 15 
2004 4 10 
2005 1 18 
2005 2 40 
2005 3 12 
2005 4 27
 
 

WebSphere v7, 설치된 J2EE 어플리케이션 확인하기

    MBeanFactory mf =AdminServiceFactory.getMBeanFactory();
    MBeanServer server = mf.getMBeanServer();

    ObjectName obj = new ObjectName("WebSphere:type=J2EEApplication,*");
    Set<ObjectInstance> mbeans = server.queryMBeans(obj, null);

    if(mbeans!=null ) {
        Iterator<ObjectInstance> itr = mbeans.iterator();
        while(itr.hasNext()) {
            ObjectInstance objInstance =  itr.next();

            if(objInstance!=null && objInstance.getObjectName()!=null) {
                String beanName = objInstance.getObjectName().getKeyProperty("name");

                System.out.println(beanName);
            }
        }
    }

WebSphere MBean list ( 목록 ) 확인 하기

MBeanFactory mf =AdminServiceFactory.getMBeanFactory();
List mbeanlist = mf.getMBeanTypes();
for( Object mbean : mbeanlist ){
System.out.println( mbean );
}

ConfigRepository
JVM
StatusCache
AdminOperations
J2EEDomain
ConfigService
RemoteCommandMgr
AntAgent
AppManagement
J2EEAppDeployment
DataSourceCfgHelper
NotificationService
JMXConnector
WebServer
PluginCfgGenerator
FileBrowser
Perf
PerfPrivate
SystemMetrics
TivoliPerfEngine
TivoliPerfAdvisor
ThreadPool
TargetTreeMbean
WMQConnectivityTester
ObjectPoolManager
SIBMain
PmiRmJmxService
ApplicationManager
CompositionUnitManager
Server
TraceService
RasLoggingService
SSLAdmin
DiagnosticService
ORB
HAManager
BulletinBoard
WLMAppServer
NameServer
EndpointCentralManager
TransportChannelService
SIBMQResourceDiscovery
WMQQueueDefiner
WMQInfo
WebServicesSecurityAdmin
WebServicesSecurityAlgorithmHelper
WASSchedulerCfgHelper
SecurityAdmin
FileTransferServer
TransactionService
Transaction
JMSProvider
J2CResourceAdapter
JDBCProvider
DataSource
JDBCDriver
DynaCache
WebServicesService
SdoRepository
SecurityTokenServiceAdmin
CacheableTokenMBean
ExtensionRegistryService
EJBContainer
WebcontainerDiagnosticProvider
J2EEApplication
Application
EJBModule
ObjectPool
WebContainer
PolicySetManager
SessionManager
WebModule
Servlet
Portlet
PortletApplication
AB_AlarmManager
JMSBasicFunction
JMSAdministration
ServerRuleDriverMBean
AdvisorNotificationMBean
StatelessSessionBean
JSP
CommandAssistance

2011년 8월 12일 금요일

MvsJobSubmitter 이용하여 z/WAS 에서 배치 Job JCL submit 하는 방법

 z/WAS에서 배치 Job JCL을 submit하기 위해서 다음의 사항을 먼저 체크한다.



1. z/WAS의 프로세스를 실행하는 user가 JCL이 실행되는 환경에 대한 권한이 있는지
   파일을 읽고 쓰기 위해서는 해당 데이터 셋을 읽고 쓸 수 있어야 한다.

2. submitJob , jobStatus REXX  script가 ascii 모드가 아닌지 확인 한다.
   MvsJobSubmitter는 submitJob과 jobStatus REXX script파일을 실행해서  JCL을 submit 하고 status 를 체크한다. 따라서 submitJob과 jobStatus 파일을 OMVS환경에서 봤을 때 실행가능하고 ascii 파일이 아니어야 실행할 수 있다.
   OMVS 환경에서 vi로 파일을 봤을때 정상적으로 보여야 한다. 만약 viascii로 봤을 때 내용이 보인다면 파일을 변경해야 한다. ( vi 로 새 파일을 열고 viascii에서 또는 window시스템에서 복사한 내용을 붙여 넣는 방법도 있음 )

3. jzos.script.path 환경 변수 확인
   submitJob과 jobStatus를 실행하기 위해서 해당 파일의 위치를 이 환경변수에서 찾는다.
   JZOS 압축을 풀어 놓은 곳에 sample까지 지정하면 된다. ex) /usr/lpp/jzos/sample



z/WAS에서 테스트하기 위해서는 약간의 수정이 필요 하다. MvsJobSubmitter.java를 열고 수정한다.



copyFile(), getInternalReaderWriter() 을 JSP에서 사용할 수 있도록 public 으로 변경한다.

 JSP에 job submit 하는 method를 만든다.
<%!
 MvsJob submitJob( String jclName ) throws IOException {
    MvsJobSubmitter submitter = new MvsJobSubmitter();

    submitter.copyFile( jclName, submitter.getInternalReaderWriter() );

    return submitter.submitJob();
}
%>

JSP에서 다음처럼 호출하여 job을 submit 한다.

<%
MvsJob job = submitJob("//'DATA.SET.NM(MEMBER)'");
%>


※ 이 외에 FTP를 이용하여 원격으로 job submit을 할 수도 있다. ( IBM readbook 참조 )
※ Job status를 가져오는 것은 에러가 있으나 job이 정상적으로 submit 되는 경우를 확인 함.
※ JCL file read에 문제가 있는 경우 1번항목의 권을 체크 할 것
※ JCL은 읽었으나 REXX syntax에러가 발생하는 경우 2번 항목을 체크 할 것
※ submitJob REXX script를 찾자 못하는 경우 3번 항목을 체크 할 것


2011년 8월 2일 화요일

unix shell script에서 날짜 포맷(format) 맞추기

http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/


Linux sudo 사용자 추가

/etc/group 파일의

admin 그룹에 사용자 id를 추가 하면 됨.

EJB3 Transaction

  • EJB 3 provides a built-in JTA transaction manager
  • JTA transactions and non-JTA (resource-local) transactions
  • Resource-local transactions are restricted to a single resource manager, such as a database connection


  • The default behavior described above is specified by the REQUIRED transaction attribute
  • MDBs support only the REQUIRED and NOT_SUPPORTED






2010년 9월 9일 목요일

PCOMM 화면 크기 조절

화면을 40x132로 변경하는 방법
    1. Create a PCOM session

    2. 텍스트 편집기(notepad 등)로 1에서 생성한 profile을 연다. ( .ws 파일 )
      C:\Documents and Settings\<your windows username>\Application Data\IBM\Personal Communications\<profilename>.WS
    3.  .WS 파일은 아래와 비슷한 내용이 들어 있게 된다.
    [Profile]
    ID=WS
    Version=6
    [Telnet3270]
    HostName=hostsystem.ibm.com
    Security=N
    AutoReconnect=Y
    [Communication]
    Link=telnet3270

    TerminalTypeString=IBM-DYNAMIC <== Specify only in PCOMM 5.9 and later
    [3270]
    ScreenSize=43x80
    QueryReplyMode=Auto
    HostCodePage=1047-U
    [Keyboard]
    CuaKeyboard=1
    Language=United-States
    DefaultKeyboard=C:\Documents and Settings\Someuser\Application Data\IBM\Personal Communications\kb.kmp
    IBMDefaultKeyboard=N
    [VT]
    VTCaptureLogFileName=C:\Documents and Settings\Someuser\My Documents\hostsystem.txt
    [Colors]
    BaseColorNormalProtected=5BECE9 000000
    ExtendedColorBlue=58F0F0 000000


    4. [3270] 섹션의 ScreenSize 를 40x132로 고친다. 없으면 추가한다.

    5. 파일을 저장한다. 기본 내용을 보존하고 싶으면 다른이름으로 저장한다.

    6. PCOMM을 시작하고, 작성한 profile을 시작 한다.

    7. Log on 을 아래처럼 dynamic logmode를 이용하여 한다.

    LOGON APPLID(TSO) LOGMODE(D4C32XX3)

    8. TSO 로그인을 하고, ISPF 의 셋팅으로 들어간다. (Settings 라고 입력).

    9. ISPF Settings 화면에서 Screen format 값을 3 (Max)으로 변경. Terminal Type 값을 4 (3278A)로 변경

2010년 8월 4일 수요일

Android 개발하기 1 - Hello World 1

출처 : http://developer.android.com/resources/tutorials/hello-world.html

개발 환경이 만들어 졌다면,

1. project 만들기

new -> project -> Android -> Android Project


Project 이름과, 나머지 Properties를 입력한다.

Project Name
Eclipse Project name — project 파일들이 저장된 디렉토리 이름 ( workspace에 가보면 해당 project 이름의 폴더가 존재함 ).
Application Name
사용자에게 보여질 어플 이름 — 설치되는 어플 이름이 됨.
Package Name
자바 패키지 이름, 설치되는 시스템 내에서 유일해야 하므로 본인만 쓸게 아니라면 신중히 해야 함.
Create Activity
생성될 클래스 이름. 이 클래스는 Android의 Activity 클래스의 서브 클래스로 시작 하는 클래스 임.
Min SDK Version
This value specifies the minimum API Level required by your application. For more information, seeAndroid API Levels.
Finish 버튼을 누르면 프로젝트와 관련 파일들이 생긴다. 

2. layout 추가

만들어진 HelloAndroid.java 파일을 연다. 다음처럼 되어 있다.

package com.example.helloandroid;

import android.app.Activity;
import android.os.Bundle;

public class HelloAndroid extends Activity {
   
/** Called when the activity is first created. */
   
@Override
   
public void onCreate(Bundle savedInstanceState) {
       
super.onCreate(savedInstanceState);
        setContentView
(R.layout.main);
   
}
}
onCreate()는 Activity에 정의 되어 있으며, 이 메소드를 override 한다고 선언되어 있다.
 onCreate() 메소드는 activity가 시작될때 Android system이 호출하게 된다. 따라서 모든 초기화와 UI setup을 수행 해야 한다.

3. Test

eclipse에서 Run configuration을 통해 테스트 클래스를 등록 한다.

실행을 하면 AVD가 실행되고 다음과 같은 화면을 볼 수 있다.

AVD에 자동으로 어플이 설치 되므로 따로 설치나 설치제거를 할 필요 없음.