This is a very useful trick if you want to debug in android by WiFi.


1. Connect you phone into USB
2. Open cmd
3. Type "adb tcpip 5555"
4. Remove phone from USB
5. Type "adb connect IP" (Where IP is your phone direction)

Note: To see your phone IP direction just go to wifi settings and click above your connected WiFi.

PD: If you don't want to connect over and over you phone by USB all you have to do is assign an static IP (usually in home network it always get the same so probably this is not needed) and create a little CMD script.

From now all you have to do is start Android Studio and execute the script.

The script would be something like....

adb connect "your IP"
PAUSE

Changing "your ip" for the real one (In my case 192.168.1.35)

If you are looking for some icon to your script could be something like the next:


Hope you like it guys!!





http://justcodeitdown.blogspot.kr/2014/01/wifi-debugging-in-android.html

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

c에서 logcat에 log찍기  (0) 2010.07.28
stlport  (0) 2010.07.26
c와 연동  (0) 2010.07.23
자바프로젝트에서 export한 jar를 안드로이드프로젝트에서 불러오기  (0) 2010.07.22
블로그 이미지

란마12

,

- 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

,

stlport

mobile/Android 2010. 7. 26. 16:25

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

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

란마12

,

c와 연동

mobile/Android 2010. 7. 23. 08:47

+ 관련툴 다운로드
   http://developer.android.com/sdk/ndk/index.html
   http://www.cygwin.com/

+ 설치 주의사항
   - cygwin을 한글명이 포함된 폴더에 설치하면 문제 -> 모두 지우고 영문폴더 밑에 재설치
   - ndk도 한글명 포함된 폴더에 설치하면 문제

+ 안드로이드 프로젝트 생성

+ 사용할 클래스 생성

+ c에서 사용할 헤더 만들기



+ 프로젝트폴더 밑에 jni폴더 생성
+ jni폴더 밑에 Android.mk파일 생성

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := HelloLibrary
LOCAL_SRC_FILES := NdkHello.c
include $(BUILD_SHARED_LIBRARY)

+ jni폴더 밑에 javah로 생성한 헤더파일 복사

+ jni폴더 밑에 c소스파일 생성
#include "android_ndk_test_hello_NdkHello.h"
#include 
jstring Java_android_ndk_test_hello_NdkHello_getMsgFromJni(JNIEnv *env, jobject thiz, jstring jstr)
{
    return (*env)->NewStringUTF(env, "hello from jni");
}

+ cygwin을 이용한 컴파일


+ LogCat에 로그찍기

- 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);

- 한글


+ 참고 사이트
http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/guide/jni/index.html
http://pllab.kw.ac.kr/j2seAPIs/guide/jni/spec/types.html#wp9502
http://occamsrazr.net/tt/231
http://micropilot.tistory.com/entry/Hello-Android-NDK-example
http://cafe.naver.com/jcga/1789

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

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

란마12

,

1. 자바프로젝트에서 export jar
   Workspace -> Package Explorer -> Export... -> Java -> JAR file

2. 이클립스프로젝트에서 import jar
   Workspace -> Package Explorer -> Properties -> Java Build Path -> Libraries -> Add External JARs...

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

WiFi Debugging in Android  (0) 2014.04.14
c에서 logcat에 log찍기  (0) 2010.07.28
stlport  (0) 2010.07.26
c와 연동  (0) 2010.07.23
블로그 이미지

란마12

,