본문 바로가기

Android6

[펌] 안드로이드 뒤로가기 막기 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { //하드웨어 뒤로가기 버튼에 따른 이벤트 설정case KeyEvent.KEYCODE_BACK:new AlertDialog.Builder(this).setTitle("프로그램 종료").setMessage("프로그램을 종료 하시겠습니까?").setPositiveButton("예", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {// 프로세스 종료.android.os.Process.killProcess(android.os... 2012. 11. 13.
Cocos2d-x + Visual studio 2010 + Android Visual studio 2010에서 Cocos2d-x 이용 개발한 Windows 프로그램 Android 포팅 개발환경 Eclipse indigo, NDK, Cygwin, cocos2d-x, VisualStudio 2010 1. Cocos2d-x, Cygwin, NDK 설치 하기 cocos2d-x 최신버전 (cocos2d-1.0.1-x-0.12.0 ) http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Download Cygwin http://www.cygwin.com/ NDK http://developer.android.com/tools/sdk/ndk/index.html 자세한 설치 가이드는 아래 블로그 참조하면 어렵지 않습니다. http://blog.naver.co.. 2012. 7. 10.
Adapter Adapter의 역할 위젯(List, combo, spinner등)에 일관된 interface로 data 공급. Adapter가 공급한 data가 view를 통해 selection 위젯에 표현 될지를 결정. Adapter 종류 CursorAdapter: Cursor(DB Query)로부터 데이터를 selection 위젯에 공급하는 adapter. Content Provider 가 제공하는 data를 selection위젯에 연결할 때 도 사용함. SimpleAdapter: data를 XML Layout 파일에 지정된 View형태로 표하는데 사용 함. ActivityAdapter, ActivityIconAdapter: 특정 Intent 발생 시 실행될 activity의 이름이나 아이콘 목록을 위한 adapt.. 2011. 12. 28.
[펌] 안드로이드 화면 회전 출처: http://www.jopenbusiness.com/tc/oss/ (오픈소스 비즈니스 컨설팅) 안드로이드 앱을 개발할 때, 가장 복잡하고 까다로운 것은 화면의 회전에 따른 데이터 처리일 것이다. 모바일 앱을 개발하면서 조금씩 정리해 둔 것을 풀어 본다. 화면 회전 Resource에서 화면(layout) 정의 세로 화면 : /res/layout-port/~.xml 가로 화면 : /res/layout-land/~.xml 회전 상태 확인 Android 2.1 WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); //--- orientation :.. 2011. 7. 14.
android:id= android:id="@+id/my_button" The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and expand the rest of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must be created and added to our resources (in theR.java file). There are a number of other ID resources that are offered by the Android frame.. 2011. 6. 24.
안드로이드 에뮬레이터에 한글 자판 설치 하기 우선 본 프로그램은 안드로이드펍에서 활동하시는 회색님외 여러명이 같이 만든 것 같습니다. 현재(2011.01)까지 안드로이드 에뮬레이터에서는 한글 자판이 지원되지 않습니다. 그래서 한글 자판 바이너리를 탑재해야 가능 합니다. 방법 1. 바이너리 파일을 다운로드 한다. http://www.androidpub.com/keyboard/13672 이주소에 직접 가셔서 받아도 됩니다. 2. 다운받은 파일을 안드로이드 SDK가 위치한 tool 폴더 밑으로 복사한다. 예) D:\\java\\android-sdk_r05-windows\\android-sdk-windows\\tools 3. 커맨드 창에서 바이너리를 설치한다. adb install hangulKeyboard.apk adb 명령을 아무 위치에서나 사용할 수.. 2011. 1. 11.