'안드로이드'에 해당되는 글 4건
- 2015.06.24 android-21의 ApiDemos import시 에러 해결 방법
- 2014.10.14 WindowManager$BadTokenException exception 발생 시..
- 2013.06.28 JNI c파일에서 logcat에 로그 뿌리기
- 2012.06.12 [GIT] File status (1)
android-21의 ApiDemos import하면 에러가 발생하는데, 아래와 같이 해결 가능함.
1. android-support-v4.jar 에러
Project property - Java Build Path - Libraries - Add External JARs
SDK/extras/android/support/v4 폴더에서
android-support-v4.jar 추가
2. com.google.android.mms.* 에러
에러가 발생하는 아래의 파일을 exclude
- com.example.android.apis.os
- MmsMessagingDemo.java
- MmsWapPushReceiver.java
exclude 하는 방법은, exclude할 파일을 선택한 후 마우스 우클릭
Build path - Exclude 선택
java.lang.RuntimeException: Unable to create service : android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@4311ec98 -- permission denied for this window type
발생은 코드 중, WindowManager.LayoutParams.TYPE_PHONE 사용에 의한 것으로,
AndroidManifest.xml에 android:sharedUserId="android.uid.system" 을 설정하던지 혹은
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
1. Android.mk 파일 수정
LOCAL_LDLIBS := -llog
2. JNI c파일 수정
#include <android/log.h>
__android_log_print(ANDROID_LOG_ERROR, "nativeJava","setOtpAsMouse : fd < 0");
원형 : __android_log_print(ANDROID_LOG_ERROR, TAG, MESSAGES, [vars]);
메시지 종류 : ANDROID_LOG_ERROR
ANDROID_LOG_UNKNOWN
ANDROID_LOG_DEFAULT
ANDROID_LOG_VERBOSE
ANDROID_LOG_DEBUG
ANDROID_LOG_INFO
ANDROID_LOG_WARN
ANDROID_LOG_ERROR
ANDROID_LOG_FATAL
ANDROID_LOG_SILENT
Git을 접하고 가장 생소했던 부분 중 하나인 File status.
기존 CVS 비교하며 이해하려 하는데, 다소 다른 개념때문에 혼란스러움. ㅋㅋ
Untracked |
Tracked |
||||||
Unmodified |
Modified |
Staged |
|||||
|
-------------------------------------------------------------------------------------------------------------------------> git add [something] (for tracking a new file) |
|
|||||
|
|
|
----------------> edit file |
--------------------------------------------> git add [something] (for staging the modified file) |
|
||
| <----------------------------------- for deleting : git rm [something] git commit for untracked : git rm --cached [ something] git commit |
<----------------------------------------------------------------- git commit [something] |
|
중요한 사항은 아래와 같음.
1. commit을 해야 최종 반영됨.
2. 새로운 파일의 추가 혹은 기 추가된 파일의 수정을 반영하기 위해서는, 우선 git add하여 staged 상태로 만들고, 그 후 commit 하여야 함.
3. 삭제의 경우도, git rm 이후 commit 하여야 반영됨