- Android.mk 파일에 LOCAL_LDLIBS:= -llog

#include <android/log.h>
__android_log_print(ANDROID_LOG_INFO, "ExecSamba", "pid = 0");
__android_log_print(ANDROID_LOG_INFO, "Return2: ", "%d", returnvalue2);


- 한글문제

Android Printing Unicode Log
안드로이드에서 유니코드 한글 메세지 보기

Logcat provides valuable information but sadly it cannot show unicode character like below.
이클립스의 로그켓에서는 아래와 같이 한글이 깨저 보입니다. 패배의 이클립스.. 안타깝습니다.

Eclipse LogCat

Eclipse LogCat

I know you found something but what! I cannot read square.
Eclipse LogCat does not have any encording option.

이클립스의 로그켓에서 유니코드로 인코딩 하는 옵션을 지원하지 않아서 그런건데요.
해결 방법이 있습니다.

Here is solution.
Android tool adb.exe  can show logcat as well as eclipse logcat.

cmd를 유니코드로 출력하게 설정한뒤 adb.exe를 통해 로그켓을 보는 겁니다. +_+

// run cmd with unicode mode
c:\> cmd /u

// change characterset
c:\> chcp 65001

// change font
// cmd font has to be changed to TTF font such as Lucida Console in the CMD property – font tab

// run logcat on cmd
c:\> adb logcat

then you can magically see the unicode character!
자 고생했던걸 생각하면 놀랍게도 참 이쁘게 나옵니다.

Android adb log

Android adb log


출처: http://www.cleancode.pe.kr/?p=68

'mobile > Android' 카테고리의 다른 글

WiFi Debugging in Android  (0) 2014.04.14
stlport  (0) 2010.07.26
c와 연동  (0) 2010.07.23
자바프로젝트에서 export한 jar를 안드로이드프로젝트에서 불러오기  (0) 2010.07.22
블로그 이미지

란마12

,