서버에서 오는 응답이 너무 깁니다. 그래서 안드로이드 스튜디오의 logcat 모니터에서 완전한 응답을 볼 수 없습니다.logcat 모니터에서 전체 응답 로그를 얻으시겠습니까?
응답의 전체 logcat을 가져 오는 방법이 있습니까?
서버에서 오는 응답이 너무 깁니다. 그래서 안드로이드 스튜디오의 logcat 모니터에서 완전한 응답을 볼 수 없습니다.logcat 모니터에서 전체 응답 로그를 얻으시겠습니까?
응답의 전체 logcat을 가져 오는 방법이 있습니까?
이 경우 디버그 포인트를 사용해야합니다. 완전한 응답을 얻을 수 있으며 단계별 코드 실행을 볼 수 있습니다. 자세한 내용은 당신은 아래의 웹 사이트에 갈 수 있습니다 :
예, 그 최선의 방법을 읽을 수있는 파일에 대한 답을 저장할 수 있습니다. 감사. –
맞춤 클래스 만들기. 코드에서 사용하는 중요한 방법은 @pctroll에 의해 splitAndLog입니다.
public class Utils {
/**
* Divides a string into chunks of a given character size.
*
* @param text String text to be sliced
* @param sliceSize int Number of characters
* @return ArrayList<String> Chunks of strings
*/
public static ArrayList<String> splitString(String text, int sliceSize) {
ArrayList<String> textList = new ArrayList<String>();
String aux;
int left = -1, right = 0;
int charsLeft = text.length();
while (charsLeft != 0) {
left = right;
if (charsLeft >= sliceSize) {
right += sliceSize;
charsLeft -= sliceSize;
}
else {
right = text.length();
aux = text.substring(left, right);
charsLeft = 0;
}
aux = text.substring(left, right);
textList.add(aux);
}
return textList;
}
/**
* Divides a string into chunks.
*
* @param text String text to be sliced
* @return ArrayList<String>
*/
public static ArrayList<String> splitString(String text) {
return splitString(text, 80);
}
/**
* Divides the string into chunks for displaying them
* into the Eclipse's LogCat.
*
* @param text The text to be split and shown in LogCat
* @param tag The tag in which it will be shown.
*/
public static void splitAndLog(String tag, String text) {
ArrayList<String> messageList = Utils.splitString(text);
for (String message : messageList) {
Log.d(tag, message);
}
}
}
당신은 당신이 –