본문 바로가기
728x90

Programing/Android / Java195

[JAVA] static키워드 바로알기 자바를 한번쯤 공부해본사람이라면 static키워드를 모르지는 않을 것입니다.하지만, 바르게 알고 있는 사람들은 그리 많지 않습니다. 자바경력자를 면접볼 때 static키워드에 대해서 질문하곤 합니다. 면접관 : static키워드에 대해서 설명해보세요. 응시자 : static키워드를 쓰면, 객체를 생성하지 않고도 변수나 함수를 사용할 수 있습니다. 면접관 : 왜 static키워드를 쓰나요? 응시자 : 객체를 생성하지 않아도 되니까 편리하고 속도도 빠릅니다. 면접관 : 그렇다면 모든 변수와 함수에 static을 붙이는 것이 좋겠네요? 응시자 : 가능한한 static을 붙이는 것이 좋다고 생각합니다. 면접관 : 어떤 경우에 static을 붙일 수 있고, 어떤 경우에 static을 붙일 수 없습니까? 응시자 :.. 2015. 4. 9.
[Android] Grab Android screenshot to computer via ADB There are many ways to take a screen shot on Android device. One simple way to capture the screen on Galaxy Nexus is to simultaneously press and hold Power andVolume Down buttons. The image will be saved in a "Screenshot" directory and accessible via Gallery. Quite often, however, I need to copy the captured image over to my computer. Usually, I do this with adb pull command, but if I'm going to.. 2015. 4. 2.
Linux/Google Android - chmod command (리눅스 파일 및 디렉토리 권한 변경) ■ 리눅스 시스템의 파일 및 디렉토리에 대한 권한/그룹 관리 리눅스를 사용하다 보면 권한이 중요하며, 이를 변경해 주어야 하는 경우가 발생한다.안드로이드의 경우에는 이 권한을 잘 못 설정하면 부팅이 되지 않는 경우도 발생하니 조심해야 한다. (1) 권한에 대한 관리 : 파일이나 디렉토리의 permition을 관리한다. ● 명령어 : chmod [권한값] [파일명]● 권한값에 대한 정의 : ls -al 또는 ll 명령을 통해 파일/디렉토리의 권한을 확인할 수 있다. r : 읽기권한(4) , w : 쓰기권한(2), x : 실행권한(1) - 10자리의 의미를 파악하기 위해 4파트로 나누어 해석- [디렉토리 1자리] [소유자권한 3자리] [그룹권한 3자리] [전체권한 3자리] - 권한값 읽기 : [ -rw-r-.. 2015. 3. 23.
Google Android SIGPIPE 프로세스가 읽기가 안되는 파이프에 쓰려고 한다면, 커널로 부터 SIGPIPE 신호를 받게 된다. 이것은 두개 이상의 프로세스가 파이프라인에 포함되어 있을 때 필수적이다. 참고로, 모든 시그널이 임의의 쓰레드로 전달되는 것은 아닙니다. SIGFPE (부동 소수점 연산 오류), SIGSEGV (메모리 접근 오류) 등과 같이 명백하게 시그널을 발생시킨 쓰레드가 정해져 있는 경우는 해당 쓰레드에게 시그널이 전달됩니다. 이런 시그널을 synchronous signal 이라고 하는데, SIGPIPE도 이 범주에 들지 않을까 합니다. 클라이언트에서 소켓을 끊었다고 해서 서버에 SIGPIPE가 전달되는 것은 아닙니다. SIGPIPE는 상대방이 닫은 fd로 쓰기를 하려는 순간에 발생합니다. 파이프 닫기 pclose()함.. 2015. 3. 23.
Detecting Process EXIT(Finished) in Java If you develop a more complex system, the chances of being a heterogeneous are pretty big. So if you develop a system in Java, but you have to integrate all ready build parts with other technology, the most desirable option is some kind of service oriented architecture. But when this is not available you will simply rely on an external process. To start an external process is quite simple. Just .. 2015. 3. 19.
구글 안드로이드 판매자 센터 오류 - 세금 정보를 업데이트 세금정보 입력부분을 이용하실때 판매자센터에서 빨간색 배너 부분을 클릭하셔서 들어갔는데 404 에러가 발생하는 경우, 아래와 같은 방법으로 진행을 부탁드립니다. 방법 1.1. 판매자 센터에 로그인2. 설정을 클릭3. 법인 프로필을 클릭4. 두번째 부분에 있는 세금 내역에 있는 세금정보를 확인합니다5. 파란색으로 적혀있는 세금 정보 업데이트를 클릭 6. 미국 국적자인지에 대한 문의가 나옵니다. 이때 Yes 또는 No를 클릭7. 밑에 "계속하기" 클릭 8. 모든 빈칸에 내용을 적어주시고 개인 사업자, 기업, 동업, 유한회사, 다른 업종 중 선택 9. 밑에 서명란에 이름 작성 (영어로 작성)10. 제출 버튼 클릭 일반적으로 이 방법을 통하면 1분 이내에 에러 메시지가 사라지게 됩니다.만약 다음과 같은 방법으로 .. 2015. 3. 16.
[Java] How to convert byte array to char array in java? public static char[] byteToCharArray(byte [] data){ char[] chars = new char[data.length/2]; for (int i = 0; i < chars.length; i++) chars[i] = (char) (((data[(i*2)] & 0xff) 2015. 3. 11.
자바 한글 인코딩 변환 / Java Korean Encoding & Decoding 자바 한글 인코딩 변환 샘플 String word = "자바 한글 인코딩 변환 샘플"; // UTF-8 System.out.println("utf-8 -> euc-kr : " + new String(word.getBytes("utf-8"), "euc-kr")); System.out.println("utf-8 -> ksc5601 : " + new String(word.getBytes("utf-8"), "ksc5601")); System.out.println("utf-8 -> x-windows-949 : " + new String(word.getBytes("utf-8"), "x-windows-949")); System.out.println("utf-8 -> iso-8859-1 : " + new String(.. 2015. 3. 10.
안드로이드 인텐트 사용 정리 // 웹페이지 띄우기 Uri uri = Uri.parse(Url주소); Intent intent = new Intent(Intent.ACTION_VIEW,uri); startActivity(intent); //이미지 갤러리 Intent intent = new Intent(); intent.setAction(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(intent,RESULT_IMAGEGALLERY); //카메라 사진용 Intent intent = new Intent(); // intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE); intent.setAction("android.. 2015. 3. 8.
[JAVA] How to close a JFrame with Escape(ESC)? // on ESC key close frame getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "Cancel"); getRootPane().getActionMap().put("Cancel", new AbstractAction(){ public void actionPerformed(ActionEvent e) { dispose(); } }); // on close window the close method is called setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); addWindowLis.. 2015. 3. 6.
[JAVA] How to set location of JFrame to CENTER? JFrame 화면 가운데 정렬하기 Code 1.setSize(800, 650);setLocationRelativeTo(null); Code 2.setSize(800, 650);setLocation((Toolkit.getDefaultToolkit().getScreenSize().width/2 - getSize().width/2), (Toolkit.getDefaultToolkit().getScreenSize().height/2 - getSize().height/2)); 2015. 3. 4.
[JAVA] How to maximize a JFrame through code? JAVA JFrame 최대화 하기 setExtendedState(getExtendedState()|JFrame.MAXIMIZED_BOTH ); Or public class Main extends JFrame implements INotiEvent { final Main mainFrame = new Main(); mainFrame.setExtendedState(mainFrame.getExtendedState()|JFrame.MAXIMIZED_BOTH ); 2015. 3. 4.
728x90