2017년 10월 12일 목요일

자바 데이터형

종류       설명              저장 공간    값의 범위 (최소값~최대값)
======================================================================================
boolean    논리값            1 bit        true / false
--------------------------------------------------------------------------------------
byte       부호 있는 정수    8 bits       -128 ~ 127
--------------------------------------------------------------------------------------
char       유니코드 문자     16 bits      \u0000 ~ \uFFFF
--------------------------------------------------------------------------------------
short      부호 있는 정수    16 bits      -32768 ~ 32767
--------------------------------------------------------------------------------------
int        부호 있는 정수    32 bits      -2147483648 ~ 2147483647
--------------------------------------------------------------------------------------
long       부호 있는 정수    64 bits      -9223372036854775808 ~ 9223372036854775807
--------------------------------------------------------------------------------------
float      IEEE 754 실수     32 bits      1.40239846E-45f
                                          ~ (표현 가능 양수 범위)
                                          3.40282347E+38f
--------------------------------------------------------------------------------------
double     IEEE 754 실수     64 bits      4.94065645841246544E-324
                                          ~ (표현 가능 양수 범위)
                                          1.79769313486231570E+308
--------------------------------------------------------------------------------------

2017년 10월 9일 월요일

자바 메쏘드 분리 및 인수 전달

 
 
android:background="#333333" 
android:textColor="#99ff00"
android:gravity="center_vertical"
 
 
 double input1 = Double.valueOf(edt1.getText().toString());


 m2result= calc.M2Result(input1);
 


 
 public static double M2Result(double input1) {
 
 
return input1;
 
 
} 

2017년 10월 8일 일요일

안드로이드 스튜디오 화면 고정


첫번째 방법 엑티비티 소스에 골라서 추가

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);  //강제 가로
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);  //강제 세로
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); //센서대로


두번째 방법
androidmanifest.xml 수정 방법

android:screenOrientation="portrait"

android:screenOrientation="landscape"